Package org.pepsoft.util
Class DataUtils
java.lang.Object
org.pepsoft.util.DataUtils
Utility methods for working with data.
Created by Pepijn on 9-3-2017.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longRead an unsigned 32-bit integer from a data stream.static long[][]unpackDataArray(Object data, int wordSize, int columnCount) Decode data that consists of a matrix of equally sized numbers packed into a one dimensional array.
-
Method Details
-
readUnsignedInt
Read an unsigned 32-bit integer from a data stream.- Parameters:
in- The stream to read from.- Returns:
- The next four bytes in the stream as an unsigned 32-bit integer.
- Throws:
IOException- If the stream throws anIOExceptionwhile reading the bytes.
-
unpackDataArray
Decode data that consists of a matrix of equally sized numbers packed into a one dimensional array.- Parameters:
data- The data array to unpack.wordSize- The word size in bits into which the numbers have been packed.columnCount- The number of words per line or row of the original matrix.- Returns:
- The unpacked data.
-