Class OBinaryProtocol

java.lang.Object
com.orientechnologies.orient.core.serialization.OBinaryProtocol

public class OBinaryProtocol extends Object
Static helper class to transform any kind of basic data in bytes and vice versa.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Field Details

  • Constructor Details

    • OBinaryProtocol

      public OBinaryProtocol()
  • Method Details

    • char2bytes

      public static byte[] char2bytes(char value, byte[] b, int iBeginOffset)
    • long2bytes

      public static int long2bytes(long value, OutputStream iStream) throws IOException
      Throws:
      IOException
    • long2bytes

      public static byte[] long2bytes(long value)
    • long2bytes

      public static byte[] long2bytes(long value, byte[] b, int iBeginOffset)
    • int2bytes

      public static int int2bytes(int value, OutputStream iStream) throws IOException
      Throws:
      IOException
    • int2bytes

      public static byte[] int2bytes(int value)
    • int2bytes

      public static byte[] int2bytes(int value, byte[] b, int iBeginOffset)
    • short2bytes

      public static int short2bytes(short value, OutputStream iStream) throws IOException
      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

      public static long bytes2long(InputStream iStream) throws IOException
      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

      public static int bytes2int(InputStream iStream) throws IOException
      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 array
      offset - The array offset
      Returns:
      The integer
    • bytes2short

      public static int bytes2short(InputStream iStream) throws IOException
      Throws:
      IOException
    • bytes2short

      public static short bytes2short(byte[] b, int offset)
    • bytes2char

      public static char bytes2char(byte[] b, int offset)