public abstract class PickleUtils extends Object
Constructor and Description |
---|
PickleUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
bytes_to_double(byte[] bytes,
int offset)
Convert a big endian 8-byte to a double.
|
static float |
bytes_to_float(byte[] bytes,
int offset)
Convert a big endian 4-byte to a float.
|
static int |
bytes_to_integer(byte[] bytes)
Convert a couple of bytes into the corresponding integer number.
|
static int |
bytes_to_integer(byte[] bytes,
int offset,
int size) |
static long |
bytes_to_long(byte[] bytes,
int offset)
Convert 8 little endian bytes into a long
|
static long |
bytes_to_uint(byte[] bytes,
int offset)
Convert 4 little endian bytes into an unsigned int (as a long)
|
static String |
decode_escaped(String str)
Decode a string with possible escaped char sequences in it (\x??).
|
static Number |
decode_long(byte[] data)
read an arbitrary 'long' number.
|
static String |
decode_unicode_escaped(String str)
Decode a string with possible escaped unicode in it (€)
|
static byte[] |
double_to_bytes(double d)
Convert a double to its 8-byte representation (big endian).
|
static byte[] |
encode_long(BigInteger big)
encode an arbitrary long number into a byte array (little endian).
|
static byte[] |
integer_to_bytes(int i)
Convert a signed integer to its 4-byte representation.
|
static Number |
optimizeBigint(BigInteger bigint)
Optimize a biginteger, if possible return a long primitive datatype.
|
static String |
rawStringFromBytes(byte[] data)
Construct a String from the given bytes where these are directly
converted to the corresponding chars, without using a given character
encoding
|
static short |
readbyte(InputStream input)
read a single unsigned byte
|
static void |
readbytes_into(InputStream input,
byte[] buffer,
int offset,
int length)
read a number of signed bytes into the specified location in an existing byte array
|
static byte[] |
readbytes(InputStream input,
int n)
read a number of signed bytes
|
static byte[] |
readbytes(InputStream input,
long n)
read a number of signed bytes
|
static String |
readline(InputStream input)
read a line of text, excluding the terminating LF char
|
static String |
readline(InputStream input,
boolean includeLF)
read a line of text, possibly including the terminating LF char
|
static byte[] |
str2bytes(String str)
Convert a string to a byte array, no encoding is used.
|
public static String readline(InputStream input) throws IOException
IOException
public static String readline(InputStream input, boolean includeLF) throws IOException
IOException
public static short readbyte(InputStream input) throws IOException
IOException
public static byte[] readbytes(InputStream input, int n) throws IOException
IOException
public static byte[] readbytes(InputStream input, long n) throws IOException
IOException
public static void readbytes_into(InputStream input, byte[] buffer, int offset, int length) throws IOException
IOException
public static int bytes_to_integer(byte[] bytes)
public static int bytes_to_integer(byte[] bytes, int offset, int size)
public static long bytes_to_long(byte[] bytes, int offset)
public static long bytes_to_uint(byte[] bytes, int offset)
public static byte[] integer_to_bytes(int i)
public static byte[] double_to_bytes(double d)
public static double bytes_to_double(byte[] bytes, int offset)
public static float bytes_to_float(byte[] bytes, int offset)
public static Number decode_long(byte[] data)
public static byte[] encode_long(BigInteger big)
public static Number optimizeBigint(BigInteger bigint)
public static String rawStringFromBytes(byte[] data)
public static byte[] str2bytes(String str) throws IOException
IOException
public static String decode_escaped(String str)
Copyright © 2016. All Rights Reserved.