Interface Unmarshaller

All Superinterfaces:
AutoCloseable, ByteInput, Closeable, DataInput, ObjectInput
All Known Implementing Classes:
AbstractUnmarshaller, BlockUnmarshaller, BlockUnmarshaller, ObjectInputStreamUnmarshaller, RiverUnmarshaller, SerializingCloner.StepObjectInput, SerialUnmarshaller

public interface Unmarshaller extends ObjectInput, ByteInput
An unmarshaller which reads objects from a stream.
  • Method Details

    • readObjectUnshared

      Object readObjectUnshared() throws ClassNotFoundException, IOException
      Read and return an unshared object.
      Returns:
      an unshared object
      Throws:
      ClassNotFoundException - if the class of a serialized object cannot be found
      IOException - if an error occurs
    • readObject

      <T> T readObject(Class<T> type) throws ClassNotFoundException, IOException
      Read and return an object, cast to a specific type.
      Type Parameters:
      T - the object type
      Parameters:
      type - the object class
      Returns:
      the object read from the stream
      Throws:
      ClassNotFoundException - if the class of a serialized object cannot be found
      InvalidObjectException - if the object is not of the expected type
      IOException - if an error occurs
    • readObjectUnshared

      <T> T readObjectUnshared(Class<T> type) throws ClassNotFoundException, IOException
      Read and return an unshared object, cast to a specific type.
      Type Parameters:
      T - the object type
      Parameters:
      type - the object class
      Returns:
      an unshared object
      Throws:
      ClassNotFoundException - if the class of a serialized object cannot be found
      InvalidObjectException - if the object is not of the expected type
      IOException - if an error occurs
    • start

      void start(ByteInput newInput) throws IOException
      Begin unmarshalling from a stream.
      Parameters:
      newInput - the new stream
      Throws:
      IOException - if an error occurs during setup, such as an invalid header
    • clearInstanceCache

      void clearInstanceCache() throws IOException
      Discard the instance cache.
      Throws:
      IOException - if an error occurs
    • clearClassCache

      void clearClassCache() throws IOException
      Discard the class cache. Implicitly also discards the instance cache.
      Throws:
      IOException - if an error occurs
    • finish

      void finish() throws IOException
      Finish unmarshalling from a stream. Any transient class or instance cache is discarded.
      Throws:
      IOException - if an error occurs