Class IOUtil

java.lang.Object
com.kheops.util.IOUtil

public class IOUtil extends Object
  • Constructor Details

    • IOUtil

      public IOUtil()
  • Method Details

    • close

      public static void close(InputStream is)
    • close

      public static void close(Reader reader)
    • close

      public static void close(OutputStream os)
    • close

      public static void close(Writer writer)
    • serialize

      public static byte[] serialize(Serializable object) throws IOException
      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

      public static byte[] serialize(Serializable object, boolean compress) throws IOException
      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

      public static Serializable deserialize(byte[] buffer) throws IOException, ClassNotFoundException
      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