public void initialPosition(final long position, final int initialTermId, final int termLength) {
    """
	Initialise a channel for restarting a publication at a given position.
	
	@param position      at which the publication should be started.
	@param initialTermId what which the stream would start.
	@param termLength    for the stream.
    """
        if (position < 0 || 0 != (position & (FRAME_ALIGNMENT - 1)))
        {
            throw new IllegalArgumentException("invalid position: " + position);
        }

        final int bitsToShift = LogBufferDescriptor.positionBitsToShift(termLength);
        final int termId = LogBufferDescriptor.computeTermIdFromPosition(position, bitsToShift, initialTermId);
        final int termOffset = (int)(position & (termLength - 1));

        put(INITIAL_TERM_ID_PARAM_NAME, Integer.toString(initialTermId));
        put(TERM_ID_PARAM_NAME, Integer.toString(termId));
        put(TERM_OFFSET_PARAM_NAME, Integer.toString(termOffset));
        put(TERM_LENGTH_PARAM_NAME, Integer.toString(termLength));
    }
public void initialPosition(final long position, final int initialTermId, final int termLength)
    {
        if (position < 0 || 0 != (position & (FRAME_ALIGNMENT - 1)))
        {
            throw new IllegalArgumentException("invalid position: " + position);
        }

        final int bitsToShift = LogBufferDescriptor.positionBitsToShift(termLength);
        final int termId = LogBufferDescriptor.computeTermIdFromPosition(position, bitsToShift, initialTermId);
        final int termOffset = (int)(position & (termLength - 1));

        put(INITIAL_TERM_ID_PARAM_NAME, Integer.toString(initialTermId));
        put(TERM_ID_PARAM_NAME, Integer.toString(termId));
        put(TERM_OFFSET_PARAM_NAME, Integer.toString(termOffset));
        put(TERM_LENGTH_PARAM_NAME, Integer.toString(termLength));
    }
public void initialPosition ( final long position , final int initialTermId , final int termLength ) { if ( position < 0 || 0 != ( position & ( FRAME_ALIGNMENT - 1 ) ) ) { throw new IllegalArgumentException ( "invalid position: " + position ) ; } final int bitsToShift = LogBufferDescriptor . positionBitsToShift ( termLength ) ; final int termId = LogBufferDescriptor . computeTermIdFromPosition ( position , bitsToShift , initialTermId ) ; final int termOffset = ( int ) ( position & ( termLength - 1 ) ) ; put ( INITIAL_TERM_ID_PARAM_NAME , Integer . toString ( initialTermId ) ) ; put ( TERM_ID_PARAM_NAME , Integer . toString ( termId ) ) ; put ( TERM_OFFSET_PARAM_NAME , Integer . toString ( termOffset ) ) ; put ( TERM_LENGTH_PARAM_NAME , Integer . toString ( termLength ) ) ; }
Initialise a channel for restarting a publication at a given position.

@param position      at which the publication should be started.
@param initialTermId what which the stream would start.
@param termLength    for the stream.
Initialise a channel for restarting a publication at a given position .