Package com.kheops.util
Class IOUtil
java.lang.Object
com.kheops.util.IOUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(InputStream is) static voidclose(OutputStream os) static voidstatic voidstatic Serializabledeserialize(byte[] buffer) Deserializes the specified buffer into a Serializable Java object.static Serializabledeserialize(byte[] buffer, boolean compressed) Deserializes the specified buffer into a Serializable Java object.static byte[]serialize(Serializable object) Serializes the specified Serializable Java object into a byte buffer.static byte[]serialize(Serializable object, boolean compress) Serializes the specified Serializable Java object into a byte buffer.
-
Constructor Details
-
IOUtil
public IOUtil()
-
-
Method Details
-
close
-
close
-
close
-
close
-
serialize
Serializes the specified Serializable Java object into a byte buffer.- Parameters:
object- the Serializable Java object to serialize.- Returns:
- a deserializable byte buffer.
- Throws:
IOException
-
serialize
Serializes the specified Serializable Java object into a byte buffer.- Parameters:
object- the Serializable Java object to serialize.compress- whether the compress the buffer stream (GZIP)- Returns:
- a deserializable byte buffer.
- Throws:
IOException
-
deserialize
Deserializes the specified buffer into a Serializable Java object.- Parameters:
buffer- the serialized Java object to deserialize.- Returns:
- the deserialized instance.
- Throws:
IOExceptionClassNotFoundException
-
deserialize
public static Serializable deserialize(byte[] buffer, boolean compressed) throws IOException, ClassNotFoundException Deserializes the specified buffer into a Serializable Java object.- Parameters:
buffer- the serialized Java object to deserialize.compressed- whether the buffer stream is compressed (GZIP)- Returns:
- the deserialized instance.
- Throws:
IOExceptionClassNotFoundException
-