java.io.Closeable
, java.io.DataOutput
, java.io.Flushable
, java.io.ObjectOutput
, java.lang.AutoCloseable
, ErrorInfo
public class FormatIdOutputStream extends java.io.DataOutputStream implements java.io.ObjectOutput, ErrorInfo
An ObjectOutput (henceforth 'out') preceeds objects it writes with a format id. The companion FormatIdInputStream (henceforth 'in') uses these format ids in parsing the stored data. The stream can be thought of as containing a sequence of (formatId,object) pairs interspersed with other data. The assumption is that out.writeObject() produces these pairs and in.readObject() uses the format ids to construct objects from the pairs that out.writeObject produced. The description below describes each supported pair and how in.readObject() processes it.
Note 1: The FormatIdInputStream uses Monitor.newInstanceFromIdentifier(format id) to get the class.
Note 2: An object may support more than one of the following interfaces Storable, Formatable, Serializable. In this case out.writeObject use the first of these interfaces which the object supports (based on the order listed here) to determine how to write the object.
Constructor | Description |
---|---|
FormatIdOutputStream(java.io.OutputStream out) |
Constructor for a FormatIdOutputStream
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getErrorInfo() |
|
java.lang.Exception |
getNestedException() |
|
void |
setOutput(java.io.OutputStream out) |
Set the OutputStream for this FormatIdOutputStream to the stream
provided.
|
void |
writeObject(java.lang.Object ref) |
Write a format id for the object provied followed by the
object itself to this FormatIdOutputStream.
|
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public FormatIdOutputStream(java.io.OutputStream out)
out
- output goes here.public void writeObject(java.lang.Object ref) throws java.io.IOException
writeObject
in interface java.io.ObjectOutput
ref
- a reference to the object.java.io.IOException
- the exception.public void setOutput(java.io.OutputStream out)
out
- The new output stream.public java.lang.String getErrorInfo()
getErrorInfo
in interface ErrorInfo
public java.lang.Exception getNestedException()
getNestedException
in interface ErrorInfo
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.