public class LittleEndianByteUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
bytesToInt(byte[] value)
Convert the given 4-byte array to int.
|
static long |
bytesToLong(byte[] value)
Convert the given 8-byte array to long.
|
static short |
bytesToShort(byte[] value)
Convert the given 2-byte array to short.
|
static byte[] |
intToBytes(int value)
Returns byte-array-representation of the given int.
|
static byte[] |
longToBytes(long value)
Returns byte-array-representation of the given long.
|
static byte[] |
shortToBytes(short value)
Returns byte-array-representation of the given int.
|
static byte[] |
writeInt(int source,
byte[] target,
int index)
Writes the given int to the given target byte[] starting from the given index.
|
static byte[] |
writeLong(long source,
byte[] target,
int index)
Writes the given long to the given target byte[] starting from the given index.
|
static byte[] |
writeShort(short source,
byte[] target,
int index)
Writes the given short to the given target byte[] starting from the given index.
|
public static int bytesToInt(byte[] value)
public static long bytesToLong(byte[] value)
public static short bytesToShort(byte[] value)
public static byte[] intToBytes(int value)
public static byte[] longToBytes(long value)
public static byte[] shortToBytes(short value)
public static byte[] writeInt(int source,
byte[] target,
int index)
public static byte[] writeLong(long source,
byte[] target,
int index)
public static byte[] writeShort(short source,
byte[] target,
int index)
Copyright © 2026. All rights reserved.