edu.jhu.tmaj.util
Class ByteUtil
java.lang.Object
edu.jhu.tmaj.util.ByteUtil
public final class ByteUtil
- extends java.lang.Object
Provides methods for converting byte arrays to objects, and objects to byte arrays
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteUtil
public ByteUtil()
convertBytesToObject
public static java.lang.Object convertBytesToObject(byte[] bytes)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
convertObjectToBytes
public static byte[] convertObjectToBytes(java.lang.Object obj)
throws java.io.IOException
- Throws:
java.io.IOException
convertBytesToObject
public static java.lang.Object convertBytesToObject(byte[] bytes,
boolean isObjectCompressed)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
convertObjectToBytes
public static byte[] convertObjectToBytes(java.lang.Object obj,
boolean useCompression)
throws java.io.IOException
- Throws:
java.io.IOException
getCompressedObjectSize
public static int getCompressedObjectSize(java.lang.Object object)
throws java.io.IOException
- Throws:
java.io.IOException
getUncompressedObjectSize
public static int getUncompressedObjectSize(java.lang.Object object)
throws java.io.IOException
- Throws:
java.io.IOException
writeByteArrayToFile
public static void writeByteArrayToFile(java.io.File file,
byte[] bytes)
throws java.io.IOException
- Throws:
java.io.IOException
readByteArrayFromFile
public static byte[] readByteArrayFromFile(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException