read
public abstract Pair<Annotation,InputStream> read(InputStream is)
throws IOException,
ClassNotFoundException,
ClassCastException
Read a single object from this stream. Subsequent calls to read on the same input stream must supply the
returned input stream; furthermore, implementations of this function must be prepared to handle the same
input stream being passed to it as it returned on the previous read.
- Parameters:
is
- The input stream to read a document from.
- Returns:
- A pair of the read document, and the implementation-specific input stream which it was actually read from.
This stream should be passed to subsequent calls to read on the same stream, and should be closed when reading
completes.
- Throws:
IOException
- Thrown if the underlying stream throws the exception.
ClassNotFoundException
- Thrown if an object was read that does not exist in the classpath.
ClassCastException
- Thrown if the signature of a class changed in way that was incompatible with the serialized document.