Package net.morimekta.util
Class BinaryUtil
- java.lang.Object
-
- net.morimekta.util.BinaryUtil
-
public class BinaryUtil extends java.lang.Object
Utility class for Binary conversion from and to binary array from Collections.
-
-
Constructor Summary
Constructors Constructor Description BinaryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
fromBinaryCollection(java.util.Collection<Binary> binaryList)
Method to convert a Collection of Binary to a byte array.static java.util.Collection<Binary>
toBinaryCollection(byte[] bytes)
Method to convert a byte array to a Collection of Binary.
-
-
-
Method Detail
-
fromBinaryCollection
public static byte[] fromBinaryCollection(java.util.Collection<Binary> binaryList) throws java.io.IOException
Method to convert a Collection of Binary to a byte array.- Parameters:
binaryList
- Collection containing Binary elements.- Returns:
- Array of bytes.
- Throws:
java.io.IOException
- If unable to write binary to bytes, e.g. on buffer overflow.
-
toBinaryCollection
public static java.util.Collection<Binary> toBinaryCollection(byte[] bytes) throws java.io.IOException
Method to convert a byte array to a Collection of Binary.- Parameters:
bytes
- Array of bytes.- Returns:
- Collection of Binary.
- Throws:
java.io.IOException
- If unable to read the binary collection.
-
-