Package com.kheops.util
Class IOUtil
java.lang.Object
com.kheops.util.IOUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
close
(InputStream is) static void
close
(OutputStream os) static void
static void
static Serializable
deserialize
(byte[] buffer) Deserializes the specified buffer into a Serializable Java object.static Serializable
deserialize
(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:
IOException
ClassNotFoundException
-
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:
IOException
ClassNotFoundException
-