/// <summary> /// Read a block from the channel. Read the first byte, determine size and if /// more are coming, set state accordingly and store content. NOTE: After /// this op the buffer is flipped, ready to read. /// </summary> private void ReadNextBlock() { int blockSize = _source.readUnsignedByte(); _byteBuffer.clear(); _moreBlocks = blockSize == BlockLogBuffer.FULL_BLOCK_AND_MORE; int limit = _moreBlocks ? BlockLogBuffer.DataSize : blockSize; _byteBuffer.limit(limit); _source.readBytes(_byteBuffer); _byteBuffer.flip(); }
public override short ReadUnsignedByte() { return(_buffer.readUnsignedByte()); }