| Package | Description |
|---|---|
| io.appulse.utils |
| Modifier and Type | Class and Description |
|---|---|
class |
BytesByteBuf |
class |
BytesPool.PooledBytes
Specific
Bytes implementation for the pools. |
| Modifier and Type | Method and Description |
|---|---|
static Bytes |
Bytes.allocate(int size)
Create a new
Bytes instance with a fixed size content. |
static Bytes |
Bytes.copy(byte[] bytes)
Copies a byte array into a new
Bytes object. |
static Bytes |
Bytes.copy(ByteBuffer buffer)
Copies a
ByteBuffer buffer into a new Bytes object. |
static Bytes |
ReadBytesUtils.read(@NonNull InputStream inputStream)
Reads all bytes from the stream till the end of the stream.
|
static Bytes |
ReadBytesUtils.read(@NonNull InputStream inputStream,
int length)
Reads all bytes from the stream till the end of the stream or
requested length reached.
|
Bytes |
Bytes.readBytes(byte[] destination)
Reads this buffer's data to the specified destination starting at
the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= destination.length). |
Bytes |
BytesPool.PooledBytes.readBytes(byte[] destination,
int offset,
int length) |
Bytes |
BytesByteBuf.readBytes(byte[] destination,
int offset,
int length) |
Bytes |
Bytes.readBytes(byte[] destination,
int offset,
int length)
Reads this buffer's data to the specified destination starting at
the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= length). |
static Bytes |
SocketUtils.readBytes(@NonNull Socket socket) |
static Bytes |
SocketUtils.readBytes(@NonNull Socket socket,
int fixedLength) |
Bytes |
BytesPool.PooledBytes.readerIndex(int newIndex) |
Bytes |
BytesByteBuf.readerIndex(int newIndex) |
Bytes |
Bytes.readerIndex(int newIndex)
Sets the
readerIndex of this buffer. |
static Bytes |
Bytes.readOnly(byte[] bytes)
Wraps a byte array into a new read-only
Bytes object. |
static Bytes |
Bytes.readOnly(ByteBuffer buffer)
Wraps a
ByteBuffer buffer into a new read-only Bytes object. |
static Bytes |
Bytes.readOnly(Bytes delegate)
|
Bytes |
Bytes.reset()
Sets the
readerIndex and writerIndex of this buffer to
0. |
static Bytes |
Bytes.resizableArray()
Creates a new
Bytes instance with a resizable content. |
static Bytes |
Bytes.resizableArray(int initialSize)
Creates a new
Bytes instance with a resizable content. |
Bytes |
BytesPool.PooledBytes.set1B(int index,
byte value) |
Bytes |
BytesByteBuf.set1B(int index,
byte value) |
Bytes |
Bytes.set1B(int index,
byte value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set1B(int index,
char value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set1B(int index,
double value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set1B(int index,
float value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set1B(int index,
int value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set1B(int index,
long value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set1B(int index,
short value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
Bytes.set2B(int index,
byte value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set2B(int index,
char value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set2B(int index,
double value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set2B(int index,
float value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set2B(int index,
int value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set2B(int index,
long value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
BytesPool.PooledBytes.set2B(int index,
short value) |
Bytes |
BytesByteBuf.set2B(int index,
short value) |
Bytes |
Bytes.set2B(int index,
short value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set4B(int index,
byte value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set4B(int index,
char value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set4B(int index,
double value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set4B(int index,
float value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
BytesPool.PooledBytes.set4B(int index,
int value) |
Bytes |
BytesByteBuf.set4B(int index,
int value) |
Bytes |
Bytes.set4B(int index,
int value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set4B(int index,
long value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set4B(int index,
short value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set8B(int index,
byte value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set8B(int index,
char value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set8B(int index,
double value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set8B(int index,
float value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set8B(int index,
int value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
BytesPool.PooledBytes.set8B(int index,
long value) |
Bytes |
BytesByteBuf.set8B(int index,
long value) |
Bytes |
Bytes.set8B(int index,
long value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.set8B(int index,
short value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
Bytes.setNB(int index,
byte[] bytes)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
Bytes.setNB(int index,
byte[] bytes,
int offset)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
BytesPool.PooledBytes.setNB(int index,
byte[] bytes,
int offset,
int length) |
Bytes |
BytesByteBuf.setNB(int index,
byte[] bytes,
int offset,
int length) |
Bytes |
Bytes.setNB(int index,
byte[] bytes,
int offset,
int length)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
Bytes.setNB(int index,
String value)
Sets the specified string at the specified absolute
index
in this buffer. |
Bytes |
Bytes.setNB(int index,
String value,
Charset charset)
Sets the specified string at the specified absolute
index
in this buffer. |
Bytes |
BytesSliceBuilder.toMutableBytes()
|
Bytes |
BytesSliceBuilder.toNewBytes()
|
Bytes |
BytesSliceBuilder.toReadOnlyBytes()
|
static Bytes |
Bytes.wrap(byte[] bytes)
Wraps a byte array into a new
Bytes object. |
static Bytes |
Bytes.wrap(ByteBuffer buffer)
Wraps a
ByteBuffer buffer into a new Bytes object. |
Bytes |
BytesPool.PooledBytes.write1B(byte value) |
Bytes |
BytesByteBuf.write1B(byte value) |
Bytes |
Bytes.write1B(byte value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write1B(char value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write1B(double value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write1B(float value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write1B(int value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write1B(long value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write1B(short value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
Bytes.write2B(byte value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
Bytes.write2B(char value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
Bytes.write2B(double value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
Bytes.write2B(float value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
Bytes.write2B(int value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
Bytes.write2B(long value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
BytesPool.PooledBytes.write2B(short value) |
Bytes |
BytesByteBuf.write2B(short value) |
Bytes |
Bytes.write2B(short value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
Bytes.write4B(byte value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
Bytes.write4B(char value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
Bytes.write4B(double value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
Bytes.write4B(float value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
BytesPool.PooledBytes.write4B(int value) |
Bytes |
BytesByteBuf.write4B(int value) |
Bytes |
Bytes.write4B(int value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
Bytes.write4B(long value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
Bytes.write4B(short value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
Bytes.write8B(byte value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
Bytes.write8B(char value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
Bytes.write8B(double value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
Bytes.write8B(float value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
Bytes.write8B(int value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
BytesPool.PooledBytes.write8B(long value) |
Bytes |
BytesByteBuf.write8B(long value) |
Bytes |
Bytes.write8B(long value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
Bytes.write8B(short value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
Bytes.writeNB(byte[] bytes)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by bytes.length
in this buffer. |
Bytes |
Bytes.writeNB(byte[] bytes,
int offset)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by bytes.length-offset
in this buffer. |
Bytes |
BytesPool.PooledBytes.writeNB(byte[] bytes,
int offset,
int length) |
Bytes |
BytesByteBuf.writeNB(byte[] bytes,
int offset,
int length) |
Bytes |
Bytes.writeNB(byte[] bytes,
int offset,
int length)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by length
in this buffer. |
Bytes |
Bytes.writeNB(String value)
Sets the specified string at the current
writerIndex
and increases the writerIndex by string.length()
in this buffer. |
Bytes |
Bytes.writeNB(String value,
Charset charset)
Sets the specified string at the current
writerIndex
and increases the writerIndex by string.length()
in this buffer. |
Bytes |
BytesPool.PooledBytes.writerIndex(int newIndex) |
Bytes |
BytesByteBuf.writerIndex(int newIndex) |
Bytes |
Bytes.writerIndex(int newIndex)
Sets the
writerIndex of this buffer. |
| Modifier and Type | Method and Description |
|---|---|
static String |
HexUtil.prettyHexDump(@NonNull Bytes buffer)
Returns a multi-line hexadecimal dump of the specified
Bytes that is easy to read by humans. |
static String |
HexUtil.prettyHexDump(@NonNull Bytes buffer,
int offset,
int length)
Returns a multi-line hexadecimal dump of the specified
Bytes that is easy to read by humans,
starting at the given offset using the given length. |
static int |
ReadBytesUtils.read(File file,
@NonNull Bytes buffer)
Reads the bytes from the file to the specified buffer.
|
static int |
ReadBytesUtils.read(@NonNull File file,
Bytes buffer,
int length)
Reads the bytes from the file to the specified buffer.
|
static int |
ReadBytesUtils.read(InputStream inputStream,
@NonNull Bytes buffer)
Reads all bytes from the stream to the specified buffer.
|
static int |
ReadBytesUtils.read(@NonNull InputStream inputStream,
@NonNull Bytes buffer,
int length)
Reads the bytes from the stream to the specified buffer.
|
static int |
ReadBytesUtils.read(Path path,
@NonNull Bytes buffer)
Reads the bytes from the file to the specified buffer.
|
static int |
ReadBytesUtils.read(@NonNull Path path,
Bytes buffer,
int length)
Reads the bytes from the file to the specified buffer.
|
static int |
ReadBytesUtils.read(ReadableByteChannel channel,
@NonNull Bytes buffer)
Reads all bytes from the channel to the specified buffer.
|
static int |
ReadBytesUtils.read(@NonNull ReadableByteChannel channel,
@NonNull Bytes buffer,
int length)
Reads all bytes from the channel to the specified buffer.
|
static Bytes |
Bytes.readOnly(Bytes delegate)
|
static int |
WriteBytesUtils.write(File file,
@NonNull Bytes buffer) |
static int |
WriteBytesUtils.write(@NonNull File file,
Bytes buffer,
int length) |
static int |
WriteBytesUtils.write(OutputStream outputStream,
@NonNull Bytes buffer) |
static int |
WriteBytesUtils.write(@NonNull OutputStream outputStream,
@NonNull Bytes buffer,
int length) |
static int |
WriteBytesUtils.write(Path path,
@NonNull Bytes buffer) |
static int |
WriteBytesUtils.write(@NonNull Path path,
Bytes buffer,
int length) |
static int |
WriteBytesUtils.write(WritableByteChannel channel,
@NonNull Bytes buffer) |
static int |
WriteBytesUtils.write(@NonNull WritableByteChannel channel,
@NonNull Bytes buffer,
int length) |
| Constructor and Description |
|---|
BytesInputStream(Bytes bytes)
Creates a
BytesInputStream
so that it uses bytes as its
buffer array. |
BytesOutputStream(Bytes bytes)
The constructor wraps already existent
Bytes. |
Copyright © 2019–2020 Appulse. All rights reserved.