public class BytesUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
compress(byte[] bytes) |
static byte[] |
doublesToOctets(double[] doubles) |
static byte[] |
doubleToOctet(double real)
Convert one double into eight bytes
|
static byte[] |
floatsToQuads(float[] floats) |
static byte[] |
floatToQuad(float real)
Convert one float into four bytes
|
static double[] |
octetsToDoubles(byte[] bytes,
double[] doubles) |
static double |
octetToDouble(byte... bytes)
Convert eight bytes into one double
|
static double[] |
quadsToDoubles(byte[] bytes,
double[] doubles) |
static float[] |
quadsToFloats(byte[] bytes,
float[] floats) |
static float |
quadToFloat(byte... bytes)
Convert four bytes into one float
|
static byte[] |
uncompress(byte[] bytes,
int compressedLen,
int uncompressedLen) |
public static float quadToFloat(byte... bytes)
bytes - the quad to convertIllegalArgumentException - if not four bytespublic static double octetToDouble(byte... bytes)
bytes - the octet to convertIllegalArgumentException - if not eight bytespublic static byte[] floatToQuad(float real)
real - the float to convertpublic static byte[] doubleToOctet(double real)
real - the double to convertpublic static float[] quadsToFloats(byte[] bytes,
float[] floats)
public static double[] quadsToDoubles(byte[] bytes,
double[] doubles)
public static double[] octetsToDoubles(byte[] bytes,
double[] doubles)
public static byte[] floatsToQuads(float[] floats)
public static byte[] doublesToOctets(double[] doubles)
public static byte[] uncompress(byte[] bytes,
int compressedLen,
int uncompressedLen)
throws DataFormatException
DataFormatExceptionpublic static byte[] compress(byte[] bytes)
throws DataFormatException
DataFormatExceptionCopyright © 2016. All Rights Reserved.