Package com.orbbec.obsensor

## Class DataUtilities

- java.lang.Object
- - com.orbbec.obsensor.DataUtilities

    public final class DataUtilities
    extends java.lang.Object

data processing tools

### Constructor Summary

Constructors
`DataUtilities()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `appendBytes​(byte[] src, byte[] dst, int offset, int length)` byte array concatenation
`static float` `bytesToFloat​(byte[] bytes)` Convert byte array to float array
`static float[]` `bytesToFloats​(byte[] bytes, int count)` Convert byte array to float array
`static int` `bytesToInt​(byte[] bytes)` Convert byte array to int data
`static int[]` `bytesToInts​(byte[] bytes, int count)` Convert byte array to int array
`static short` `bytesToShort​(byte[] bytes)` Convert byte array to short data
`static short[]` `bytesToShorts​(byte[] bytes, int count)` Convert byte array to short array
`static java.lang.String` `bytesToString​(byte[] bytes)` Convert byte array to String
`static byte[]` `floatsToBytes​(float[] fs)` Convert float array to byte array
`static java.lang.String` `floatsToString​(float[] floats)` Convert float array to string
`static byte[]` `floatToBytes​(float f)` Convert float data type to byte array
`static byte[]` `intsToBytes​(int[] is)` Convert int array to byte array
`static java.lang.String` `intsToString​(int[] ints)` int array converted to string
`static byte[]` `intToBytes​(int i)` Convert int type data to byte array
`static byte[]` `shortsToBytes​(short[] ss)` Convert short array to byte array
`static byte[]` `shortToBytes​(short s)` Convert short data to byte array
`static byte[]` `stringToBytes​(java.lang.String s)` Convert String to byte array
`static byte[]` `subBytes​(byte[] bytes, int offset, int length)` Intercept byte array

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DataUtilities

    public DataUtilities()

### Method Detail

#### subBytes

    public static byte[] subBytes​(byte[] bytes,
                                  int offset,
                                  int length)

Intercept byte array

Parameters:
  `bytes` - array to be intercepted
  `offset` - start position of interception
  `length` - intercepted length
Returns:
  Return the truncated array

#### appendBytes

    public static void appendBytes​(byte[] src,
                                   byte[] dst,
                                   int offset,
                                   int length)

byte array concatenation

Parameters:
  `src` - array to be concatenated
  `dst` - concatenated array
  `offset` - splicing start position
  `length` - splice length

#### shortToBytes

    public static byte[] shortToBytes​(short s)

Convert short data to byte array

Parameters:
  `s` - data to be converted
Returns:
  Converted byte array

#### shortsToBytes

    public static byte[] shortsToBytes​(short[] ss)

Convert short array to byte array

Parameters:
  `ss` - array of shorts to convert
Returns:
  Converted byte array

#### bytesToShort

    public static short bytesToShort​(byte[] bytes)

Convert byte array to short data

Parameters:
  `bytes` - The byte array to be converted
Returns:
  converted short data

#### bytesToShorts

    public static short[] bytesToShorts​(byte[] bytes,
                                        int count)

Convert byte array to short array

Parameters:
  `bytes` - The byte array to be converted
  `count` - the length of the short array
Returns:
  converted array of shorts

#### intToBytes

    public static byte[] intToBytes​(int i)

Convert int type data to byte array

Parameters:
  `i` - int data to be converted
Returns:
  converted byte array

#### intsToBytes

    public static byte[] intsToBytes​(int[] is)

Convert int array to byte array

Parameters:
  `is` - the array of ints to convert
Returns:
  converted byte array

#### bytesToInt

    public static int bytesToInt​(byte[] bytes)

Convert byte array to int data

Parameters:
  `bytes` - The byte array to be converted
Returns:
  converted int type data

#### bytesToInts

    public static int[] bytesToInts​(byte[] bytes,
                                    int count)

Convert byte array to int array

Parameters:
  `bytes` - The byte array to be converted
  `count` - the length of the converted int array
Returns:
  converted int array

#### floatToBytes

    public static byte[] floatToBytes​(float f)

Convert float data type to byte array

Parameters:
  `f` - float data type to convert
Returns:
  converted byte array

#### floatsToBytes

    public static byte[] floatsToBytes​(float[] fs)

Convert float array to byte array

Parameters:
  `fs` - array of floats to convert
Returns:
  converted byte array

#### bytesToFloat

    public static float bytesToFloat​(byte[] bytes)

Convert byte array to float array

Parameters:
  `bytes` - The byte array to be converted
Returns:
  the length of the converted float array

#### bytesToFloats

    public static float[] bytesToFloats​(byte[] bytes,
                                        int count)

Convert byte array to float array

Parameters:
  `bytes` - The byte array to be converted
  `count` - the length of the converted float array
Returns:
  converted float array

#### stringToBytes

    public static byte[] stringToBytes​(java.lang.String s)

Convert String to byte array

Parameters:
  `s` - String to convert
Returns:
  converted byte array

#### bytesToString

    public static java.lang.String bytesToString​(byte[] bytes)

Convert byte array to String

Parameters:
  `bytes` - The byte array to be converted
Returns:
  converted string

#### floatsToString

    public static java.lang.String floatsToString​(float[] floats)

Convert float array to string

Parameters:
  `floats` - array of floats to convert
Returns:
  converted string

#### intsToString

    public static java.lang.String intsToString​(int[] ints)

int array converted to string

Parameters:
  `ints` - array of ints to convert
Returns:
  converted string