Class FormatIdInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
org.apache.derby.iapi.services.io.FormatIdInputStream
- All Implemented Interfaces:
Closeable, DataInput, ObjectInput, AutoCloseable, CloneableStream, ErrorInfo, ErrorObjectInput, Resetable
public final class FormatIdInputStream
extends DataInputStream
implements ErrorObjectInput, Resetable, CloneableStream
A stream for reading objects with format id tags which was
produced by a FormatIdOutputStream.
Please see the documentation for FormatIdOutputStream for information about the streams format and capabilites.
-
Field Summary
FieldsFields inherited from class FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClone the stream.voidClose.(package private) ClassFactoryprivate static ContextgetContextOrNull(String contextID) Privileged lookup of a Context.private ObjectInputStreamprivate <T extends Throwable>
ThandleReadError(T cause, ObjectInputStream stream) Handle an error that happened withinreadObject()when reading aSerializableobject.voidInitialize.Read an object from this stream.voidReset the stream to the beginning.private voidvoidsetInput(InputStream in) Set the InputStream for this FormatIdInputStream to the stream provided.Methods inherited from class DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytesMethods inherited from class FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferToMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
-
Field Details
-
cf
-
errorInfo
-
myNestedException
-
-
Constructor Details
-
FormatIdInputStream
Constructor for a FormatIdInputStream- Parameters:
in- bytes come from here.
-
-
Method Details
-
readObject
Read an object from this stream.- Specified by:
readObjectin interfaceObjectInput- Returns:
- The read object.
- Throws:
IOException- An IO or serialization error occurred.ClassNotFoundException- A class for an object in the stream could not be found.
-
setInput
Set the InputStream for this FormatIdInputStream to the stream provided.- Parameters:
in- The new input stream.
-
getInputStream
-
getErrorInfo
- Specified by:
getErrorInfoin interfaceErrorInfo- Specified by:
getErrorInfoin interfaceErrorObjectInput
-
getNestedException
- Specified by:
getNestedExceptionin interfaceErrorInfo- Specified by:
getNestedExceptionin interfaceErrorObjectInput
-
setErrorInfo
-
handleReadError
Handle an error that happened withinreadObject()when reading aSerializableobject.- Type Parameters:
T- the type of exception that was thrown- Parameters:
cause- the thrown exceptionstream- the stream from which the exception was thrown- Returns:
- the thrown exception
-
getClassFactory
ClassFactory getClassFactory() -
getObjectStream
- Throws:
IOException
-
resetStream
Description copied from interface:ResetableReset the stream to the beginning.- Specified by:
resetStreamin interfaceResetable- Throws:
IOExceptionStandardException- See Also:
-
initStream
Description copied from interface:ResetableInitialize. Needs to be called first, before a resetable stream can be used.- Specified by:
initStreamin interfaceResetable- Throws:
StandardException- See Also:
-
closeStream
public void closeStream()Description copied from interface:ResetableClose. Free resources (such as open containers and locks) associated with the stream.- Specified by:
closeStreamin interfaceResetable- See Also:
-
cloneStream
Description copied from interface:CloneableStreamClone the stream.To be used when a "deep" clone of a stream is required rather than multiple references to the same stream.
The resulting clone should support reads, resets, closes which do not affect the original stream source of the clone.
- Specified by:
cloneStreamin interfaceCloneableStream- Returns:
- The cloned stream.
- See Also:
-
getContextOrNull
-