- All Implemented Interfaces:
DataInput
,ObjectInput
,AutoCloseable
FastExternalizable
, Externalizable
, and Serializable
objects.
When multiple objects are being written, this avoids the repetitive writing of classnames and serialVersionUIDs.
Any object that is ObjectInputValidation
is validated immediately - there is no need
and no mechanism to register the validation since this is for simple value objects
that don't participate in more complex object graphs.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) boolean
byte
readByte()
char
readChar()
double
protected FastExternalizable
Reads aFastExternalizable
object from the stream.Reads a fast serializedString
from the stream.float
void
readFully
(byte[] b) void
readFully
(byte[] b, int off, int len) int
readInt()
readLine()
long
readLong()
Reads a possibly-FastExternalizable
object from the stream.short
int
int
readUTF()
long
skip
(long n) int
skipBytes
(int n) void
unwrap()
Unwraps the object input.static FastObjectInput
wrap
(ObjectInput in) Gets the wrapper for the providedObjectInput
, creating if needed.
-
Method Details
-
wrap
Gets the wrapper for the providedObjectInput
, creating if needed. To avoid memory leaks, it must also beunwrapped
in a finally block.TODO: Can
FastObjectInput
itself implementAutoCloseable
forunwrap()
? Maybe this means it no longer implementsObjectInput
directly?- Throws:
IOException
-
unwrap
Unwraps the object input.- Throws:
IllegalStateException
- if not wrapped
-
readObject
Reads a possibly-FastExternalizable
object from the stream.- Specified by:
readObject
in interfaceObjectInput
- Throws:
IOException
ClassNotFoundException
- See Also:
-
readFastObject
Reads aFastExternalizable
object from the stream.- Throws:
IOException
ClassNotFoundException
- See Also:
-
readFastUTF
Reads a fast serializedString
from the stream.- Throws:
IOException
- See Also:
-
read
- Specified by:
read
in interfaceObjectInput
- Throws:
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Throws:
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Throws:
IOException
-
skip
- Specified by:
skip
in interfaceObjectInput
- Throws:
IOException
-
available
- Specified by:
available
in interfaceObjectInput
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceObjectInput
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
skipBytes
- Specified by:
skipBytes
in interfaceDataInput
- Throws:
IOException
-
readBoolean
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readInt
- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readLong
- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
readLine
- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
-
readUTF
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-