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
ConstructorDescriptionByteArrayByteBuffer
(byte[] underlyingBytes) ByteArrayByteBuffer
(byte[] underlyingBytes, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionasNioBuffer
(int index, int length) capacity
(int capacity) byte
getByte
(int index) int
indexOf
(byte b) int
byte
read()
read
(byte[] destination) read
(byte[] destination, int offset, int length) int
readCharSequence
(int length, Charset charset) int
readerIndex
(int readPosition) slice
(int index, int length) byte[]
int
write
(byte b) write
(byte[] source) write
(byte[] source, int offset, int length) write
(ByteBuffer... buffers) write
(CharSequence source, Charset charset) write
(ByteBuffer... buffers) int
writerIndex
(int position)
-
Constructor Details
-
ByteArrayByteBuffer
public ByteArrayByteBuffer(byte[] underlyingBytes) -
ByteArrayByteBuffer
public ByteArrayByteBuffer(byte[] underlyingBytes, int capacity)
-
-
Method Details
-
asNativeBuffer
- Specified by:
asNativeBuffer
in interfaceByteBuffer<T>
-
readableBytes
public int readableBytes()- Specified by:
readableBytes
in interfaceByteBuffer<T>
-
writableBytes
public int writableBytes()- Specified by:
writableBytes
in interfaceByteBuffer<T>
-
maxCapacity
public int maxCapacity()- Specified by:
maxCapacity
in interfaceByteBuffer<T>
-
capacity
- Specified by:
capacity
in interfaceByteBuffer<T>
-
readerIndex
public int readerIndex()- Specified by:
readerIndex
in interfaceByteBuffer<T>
-
readerIndex
- Specified by:
readerIndex
in interfaceByteBuffer<T>
-
writerIndex
public int writerIndex()- Specified by:
writerIndex
in interfaceByteBuffer<T>
-
writerIndex
- Specified by:
writerIndex
in interfaceByteBuffer<T>
-
read
public byte read()- Specified by:
read
in interfaceByteBuffer<T>
-
readCharSequence
- Specified by:
readCharSequence
in interfaceByteBuffer<T>
-
read
- Specified by:
read
in interfaceByteBuffer<T>
-
read
- Specified by:
read
in interfaceByteBuffer<T>
-
write
- Specified by:
write
in interfaceByteBuffer<T>
-
write
- Specified by:
write
in interfaceByteBuffer<T>
-
write
- Specified by:
write
in interfaceByteBuffer<T>
-
write
- Specified by:
write
in interfaceByteBuffer<T>
-
write
- Specified by:
write
in interfaceByteBuffer<T>
-
write
- Specified by:
write
in interfaceByteBuffer<T>
-
slice
- Specified by:
slice
in interfaceByteBuffer<T>
-
asNioBuffer
- Specified by:
asNioBuffer
in interfaceByteBuffer<T>
-
asNioBuffer
- Specified by:
asNioBuffer
in interfaceByteBuffer<T>
-
toInputStream
- Specified by:
toInputStream
in interfaceByteBuffer<T>
-
toOutputStream
- Specified by:
toOutputStream
in interfaceByteBuffer<T>
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArray
in interfaceByteBuffer<T>
-
toString
- Specified by:
toString
in interfaceByteBuffer<T>
-
indexOf
public int indexOf(byte b) - Specified by:
indexOf
in interfaceByteBuffer<T>
-
getByte
public byte getByte(int index) - Specified by:
getByte
in interfaceByteBuffer<T>
-