Package io.micronaut.jaxrs.common
Class ByteArrayByteBuffer<T>
java.lang.Object
io.micronaut.jaxrs.common.ByteArrayByteBuffer<T>
- Type Parameters:
T- The byte buffer type
- All Implemented Interfaces:
ByteBuffer<T>
The implementation of
ByteBuffer for byte arrays.- Since:
- 4.6
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayByteBuffer(byte[] underlyingBytes) ByteArrayByteBuffer(byte[] underlyingBytes, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionasNioBuffer(int index, int length) capacity(int capacity) bytegetByte(int index) intindexOf(byte b) intbyteread()read(byte[] destination) read(byte[] destination, int offset, int length) intreadCharSequence(int length, Charset charset) intreaderIndex(int readPosition) slice(int index, int length) byte[]intwrite(byte b) write(byte[] source) write(byte[] source, int offset, int length) write(ByteBuffer... buffers) write(CharSequence source, Charset charset) write(ByteBuffer... buffers) intwriterIndex(int position)
-
Constructor Details
-
ByteArrayByteBuffer
public ByteArrayByteBuffer(byte[] underlyingBytes) -
ByteArrayByteBuffer
public ByteArrayByteBuffer(byte[] underlyingBytes, int capacity)
-
-
Method Details
-
asNativeBuffer
- Specified by:
asNativeBufferin interfaceByteBuffer<T>
-
readableBytes
public int readableBytes()- Specified by:
readableBytesin interfaceByteBuffer<T>
-
writableBytes
public int writableBytes()- Specified by:
writableBytesin interfaceByteBuffer<T>
-
maxCapacity
public int maxCapacity()- Specified by:
maxCapacityin interfaceByteBuffer<T>
-
capacity
- Specified by:
capacityin interfaceByteBuffer<T>
-
readerIndex
public int readerIndex()- Specified by:
readerIndexin interfaceByteBuffer<T>
-
readerIndex
- Specified by:
readerIndexin interfaceByteBuffer<T>
-
writerIndex
public int writerIndex()- Specified by:
writerIndexin interfaceByteBuffer<T>
-
writerIndex
- Specified by:
writerIndexin interfaceByteBuffer<T>
-
read
public byte read()- Specified by:
readin interfaceByteBuffer<T>
-
readCharSequence
- Specified by:
readCharSequencein interfaceByteBuffer<T>
-
read
- Specified by:
readin interfaceByteBuffer<T>
-
read
- Specified by:
readin interfaceByteBuffer<T>
-
write
- Specified by:
writein interfaceByteBuffer<T>
-
write
- Specified by:
writein interfaceByteBuffer<T>
-
write
- Specified by:
writein interfaceByteBuffer<T>
-
write
- Specified by:
writein interfaceByteBuffer<T>
-
write
- Specified by:
writein interfaceByteBuffer<T>
-
write
- Specified by:
writein interfaceByteBuffer<T>
-
slice
- Specified by:
slicein interfaceByteBuffer<T>
-
asNioBuffer
- Specified by:
asNioBufferin interfaceByteBuffer<T>
-
asNioBuffer
- Specified by:
asNioBufferin interfaceByteBuffer<T>
-
toInputStream
- Specified by:
toInputStreamin interfaceByteBuffer<T>
-
toOutputStream
- Specified by:
toOutputStreamin interfaceByteBuffer<T>
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArrayin interfaceByteBuffer<T>
-
toString
- Specified by:
toStringin interfaceByteBuffer<T>
-
indexOf
public int indexOf(byte b) - Specified by:
indexOfin interfaceByteBuffer<T>
-
getByte
public byte getByte(int index) - Specified by:
getBytein interfaceByteBuffer<T>
-