@Test public void changeReaderIndexViaReadOnlyView() { Buffer buffer = DEFAULT_ALLOCATOR.fromAscii("test"); Buffer readOnly = buffer.asReadOnly(); assertEquals(buffer.readerIndex(), readOnly.readerIndex()); readOnly.skipBytes(2); assertEquals(2, readOnly.readerIndex()); assertEquals(buffer.readerIndex(), readOnly.readerIndex()); }
@Override public Buffer asReadOnly() { return this; }
ReadOnlyBuffer extends WrappedBuffer { @Override public Buffer asReadOnly() { return this; } }
ReadOnlyBuffer extends WrappedBuffer { @Override public Buffer asReadOnly() { return this; } ReadOnlyBuffer(Buffer buffer); }
ReadOnlyBuffer extends WrappedBuffer { @Override public Buffer asReadOnly() { return this; } ReadOnlyBuffer(Buffer buffer); @Override boolean isReadOnly(); @Override Buffer asReadOnly(); @Override boolean hasArray(); @Override byte[] array(); @Override int arrayOffset(); @Override int writableBytes(); @Override int maxWritableBytes(); @Override Buffer ensureWritable(int minWritableBytes); @Override int ensureWritable(int minWritableBytes, boolean force); @Override Buffer capacity(int newCapacity); @Override Buffer setBoolean(int index, boolean value); @Override Buffer setByte(int index, int value); @Override Buffer setShort(int index, int value); @Override Buffer setShortLE(int index, int value); @Override Buffer setMedium(int index, int value); @Override Buffer setMediumLE(int index, int value); @Override Buffer setInt(int index, int value); @Override Buffer setIntLE(int index, int value); @Override Buffer setLong(int index, long value); @Override Buffer setLongLE(int index, long value); @Override Buffer setChar(int index, int value); @Override Buffer setFloat(int index, float value); @Override Buffer setDouble(int index, double value); @Override Buffer setBytes(int index, Buffer src); @Override Buffer setBytes(int index, Buffer src, int length); @Override Buffer setBytes(int index, Buffer src, int srcIndex, int length); @Override Buffer setBytes(int index, byte[] src); @Override Buffer setBytes(int index, byte[] src, int srcIndex, int length); @Override Buffer setBytes(int index, ByteBuffer src); @Override int setBytes(int index, InputStream src, int length); @Override int setBytesUntilEndStream(int index, InputStream src, int chunkSize); @Override Buffer writeBoolean(boolean value); @Override Buffer writeByte(int value); @Override Buffer writeShort(int value); @Override Buffer writeShortLE(int value); @Override Buffer writeMedium(int value); @Override Buffer writeMediumLE(int value); @Override Buffer writeInt(int value); @Override Buffer writeIntLE(int value); @Override Buffer writeLong(long value); @Override Buffer writeLongLE(long value); @Override Buffer writeChar(int value); @Override Buffer writeFloat(float value); @Override Buffer writeDouble(double value); @Override Buffer writeBytes(Buffer src); @Override Buffer writeBytes(Buffer src, int length); @Override Buffer writeBytes(Buffer src, int srcIndex, int length); @Override Buffer writeBytes(byte[] src); @Override Buffer writeBytes(byte[] src, int srcIndex, int length); @Override Buffer writeBytes(ByteBuffer src); @Override int writeBytes(InputStream src, int length); @Override int writeBytesUntilEndStream(InputStream src, int chunkSize); @Override Buffer writeAscii(CharSequence seq); @Override Buffer writeUtf8(CharSequence seq); @Override Buffer writeUtf8(CharSequence seq, int ensureWritable); @Override Buffer readSlice(int length); @Override Buffer duplicate(); @Override Buffer slice(); @Override Buffer slice(int index, int length); @Override ByteBuffer toNioBuffer(); @Override ByteBuffer toNioBuffer(int index, int length); @Override ByteBuffer[] toNioBuffers(); @Override ByteBuffer[] toNioBuffers(int index, int length); }
ReadOnlyBuffer extends WrappedBuffer { @Override public Buffer asReadOnly() { return this; } ReadOnlyBuffer(Buffer buffer); @Override boolean isReadOnly(); @Override Buffer asReadOnly(); @Override boolean hasArray(); @Override byte[] array(); @Override int arrayOffset(); @Override int writableBytes(); @Override int maxWritableBytes(); @Override Buffer ensureWritable(int minWritableBytes); @Override int ensureWritable(int minWritableBytes, boolean force); @Override Buffer capacity(int newCapacity); @Override Buffer setBoolean(int index, boolean value); @Override Buffer setByte(int index, int value); @Override Buffer setShort(int index, int value); @Override Buffer setShortLE(int index, int value); @Override Buffer setMedium(int index, int value); @Override Buffer setMediumLE(int index, int value); @Override Buffer setInt(int index, int value); @Override Buffer setIntLE(int index, int value); @Override Buffer setLong(int index, long value); @Override Buffer setLongLE(int index, long value); @Override Buffer setChar(int index, int value); @Override Buffer setFloat(int index, float value); @Override Buffer setDouble(int index, double value); @Override Buffer setBytes(int index, Buffer src); @Override Buffer setBytes(int index, Buffer src, int length); @Override Buffer setBytes(int index, Buffer src, int srcIndex, int length); @Override Buffer setBytes(int index, byte[] src); @Override Buffer setBytes(int index, byte[] src, int srcIndex, int length); @Override Buffer setBytes(int index, ByteBuffer src); @Override int setBytes(int index, InputStream src, int length); @Override int setBytesUntilEndStream(int index, InputStream src, int chunkSize); @Override Buffer writeBoolean(boolean value); @Override Buffer writeByte(int value); @Override Buffer writeShort(int value); @Override Buffer writeShortLE(int value); @Override Buffer writeMedium(int value); @Override Buffer writeMediumLE(int value); @Override Buffer writeInt(int value); @Override Buffer writeIntLE(int value); @Override Buffer writeLong(long value); @Override Buffer writeLongLE(long value); @Override Buffer writeChar(int value); @Override Buffer writeFloat(float value); @Override Buffer writeDouble(double value); @Override Buffer writeBytes(Buffer src); @Override Buffer writeBytes(Buffer src, int length); @Override Buffer writeBytes(Buffer src, int srcIndex, int length); @Override Buffer writeBytes(byte[] src); @Override Buffer writeBytes(byte[] src, int srcIndex, int length); @Override Buffer writeBytes(ByteBuffer src); @Override int writeBytes(InputStream src, int length); @Override int writeBytesUntilEndStream(InputStream src, int chunkSize); @Override Buffer writeAscii(CharSequence seq); @Override Buffer writeUtf8(CharSequence seq); @Override Buffer writeUtf8(CharSequence seq, int ensureWritable); @Override Buffer readSlice(int length); @Override Buffer duplicate(); @Override Buffer slice(); @Override Buffer slice(int index, int length); @Override ByteBuffer toNioBuffer(); @Override ByteBuffer toNioBuffer(int index, int length); @Override ByteBuffer[] toNioBuffers(); @Override ByteBuffer[] toNioBuffers(int index, int length);  }