Class OBinaryProtocol
java.lang.Object
com.orientechnologies.orient.core.serialization.OBinaryProtocol
Static helper class to transform any kind of basic data in bytes and vice versa.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic charbytes2char(byte[] b, int offset) static intbytes2int(byte[] b) Convert the byte array to an int.static intbytes2int(byte[] b, int offset) Convert the byte array to an int starting from the given offset.static intbytes2int(InputStream iStream) static longbytes2long(byte[] b) static longbytes2long(byte[] b, int offset) static longbytes2long(InputStream iStream) static shortbytes2short(byte[] b, int offset) static intbytes2short(InputStream iStream) static byte[]char2bytes(char value, byte[] b, int iBeginOffset) static byte[]int2bytes(int value) static byte[]int2bytes(int value, byte[] b, int iBeginOffset) static intint2bytes(int value, OutputStream iStream) static byte[]long2bytes(long value) static byte[]long2bytes(long value, byte[] b, int iBeginOffset) static intlong2bytes(long value, OutputStream iStream) static byte[]short2bytes(short value) static byte[]short2bytes(short value, byte[] b, int iBeginOffset) static intshort2bytes(short value, OutputStream iStream)
-
Field Details
-
SIZE_BYTE
public static final int SIZE_BYTE- See Also:
-
SIZE_CHAR
public static final int SIZE_CHAR- See Also:
-
SIZE_SHORT
public static final int SIZE_SHORT- See Also:
-
SIZE_INT
public static final int SIZE_INT- See Also:
-
SIZE_LONG
public static final int SIZE_LONG- See Also:
-
-
Constructor Details
-
OBinaryProtocol
public OBinaryProtocol()
-
-
Method Details
-
char2bytes
public static byte[] char2bytes(char value, byte[] b, int iBeginOffset) -
long2bytes
- Throws:
IOException
-
long2bytes
public static byte[] long2bytes(long value) -
long2bytes
public static byte[] long2bytes(long value, byte[] b, int iBeginOffset) -
int2bytes
- Throws:
IOException
-
int2bytes
public static byte[] int2bytes(int value) -
int2bytes
public static byte[] int2bytes(int value, byte[] b, int iBeginOffset) -
short2bytes
- Throws:
IOException
-
short2bytes
public static byte[] short2bytes(short value) -
short2bytes
public static byte[] short2bytes(short value, byte[] b, int iBeginOffset) -
bytes2long
public static long bytes2long(byte[] b) -
bytes2long
- Throws:
IOException
-
bytes2long
public static long bytes2long(byte[] b, int offset) -
bytes2int
public static int bytes2int(byte[] b) Convert the byte array to an int.- Parameters:
b- The byte array- Returns:
- The integer
-
bytes2int
- Throws:
IOException
-
bytes2int
public static int bytes2int(byte[] b, int offset) Convert the byte array to an int starting from the given offset.- Parameters:
b- The byte arrayoffset- The array offset- Returns:
- The integer
-
bytes2short
- Throws:
IOException
-
bytes2short
public static short bytes2short(byte[] b, int offset) -
bytes2char
public static char bytes2char(byte[] b, int offset)
-