public final class BytesUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
align(byte[] bytes,
int length) |
static byte[] |
asBytes(byte value) |
static byte[] |
asBytes(char value) |
static byte[] |
asBytes(double value) |
static byte[] |
asBytes(float value) |
static byte[] |
asBytes(int value) |
static byte[] |
asBytes(long value) |
static byte[] |
asBytes(short value) |
static char |
asChar(byte[] bytes) |
static double |
asDouble(byte[] bytes) |
static float |
asFloat(byte[] bytes) |
static int |
asInteger(byte[] bytes) |
static long |
asLong(byte[] bytes) |
static short |
asShort(byte[] bytes) |
static short |
asUnsignedByte(byte value)
Converts byte to unsigned byte.
|
static short |
asUnsignedByte(byte[] bytes)
Transforms byte array to unsigned byte value as short integer.
|
static long |
asUnsignedInteger(byte[] bytes)
Transforms byte array to unsigned integer value as long integer.
|
static long |
asUnsignedInteger(int value)
Transforms byte array to unsigned integer value as long integer.
|
static int |
asUnsignedShort(byte[] bytes)
Transforms byte array to unsigned short integer value as integer.
|
static int |
asUnsignedShort(short value)
Transforms byte array to unsigned short integer value as integer.
|
static byte[] |
concatenate(byte[]... arrays) |
static byte[] |
read(java.io.InputStream stream)
Reads all bytes from stream till the end of the stream.
|
static byte[] |
read(java.io.InputStream stream,
int length)
Reads fixed length bytes from the stream.
|
static Bytes |
readBytes(java.io.InputStream stream)
Reads all bytes from stream till the end of the stream.
|
static Bytes |
readBytes(java.io.InputStream stream,
int length)
Reads fixed length bytes from the stream.
|
public static byte[] asBytes(char value)
public static byte[] asBytes(byte value)
public static byte[] asBytes(short value)
public static byte[] asBytes(int value)
public static byte[] asBytes(long value)
public static byte[] asBytes(float value)
public static byte[] asBytes(double value)
public static short asUnsignedByte(byte value)
value - byte valuepublic static short asUnsignedByte(@NonNull
byte[] bytes)
bytes - byte arraypublic static short asShort(@NonNull
byte[] bytes)
public static int asUnsignedShort(short value)
value - signed short valuepublic static int asUnsignedShort(@NonNull
byte[] bytes)
bytes - byte arraypublic static char asChar(@NonNull
byte[] bytes)
public static int asInteger(@NonNull
byte[] bytes)
public static long asUnsignedInteger(int value)
value - signed integer valuepublic static long asUnsignedInteger(@NonNull
byte[] bytes)
bytes - byte arraypublic static long asLong(@NonNull
byte[] bytes)
public static float asFloat(@NonNull
byte[] bytes)
public static double asDouble(@NonNull
byte[] bytes)
public static byte[] concatenate(@NonNull
byte[]... arrays)
public static byte[] align(@NonNull
byte[] bytes,
int length)
public static byte[] read(@NonNull
java.io.InputStream stream)
stream - steampublic static byte[] read(@NonNull
java.io.InputStream stream,
int length)
stream - steamlength - how many bytes to read from streampublic static Bytes readBytes(@NonNull java.io.InputStream stream)
stream - steamBytes instanceCopyright © 2018 Appulse. All rights reserved.