public class FSTObjectInput extends Object implements ObjectInput
Modifier and Type | Class and Description |
---|---|
protected static class |
FSTObjectInput.CallbackEntry |
static interface |
FSTObjectInput.ConditionalCallback |
protected static class |
FSTObjectInput.MyObjectStream |
Modifier and Type | Field and Description |
---|---|
protected ArrayList<FSTObjectInput.CallbackEntry> |
callbacks |
protected FSTClazzInfoRegistry |
clInfoRegistry |
protected boolean |
closed |
protected FSTDecoder |
codec |
protected FSTObjectInput.ConditionalCallback |
conditionalCallback |
protected FSTConfiguration |
conf |
protected int |
curDepth |
protected Stack<String> |
debugStack |
static ByteArrayInputStream |
emptyStream |
protected FSTObjectInput.MyObjectStream |
fakeWrapper |
protected boolean |
ignoreAnnotations |
protected FSTClazzInfo.FSTFieldInfo |
infoCache |
protected boolean |
isCrossPlatform |
protected FSTObjectRegistry |
objects |
protected int |
readExternalReadAHead |
static boolean |
REGISTER_ENUMS_READ |
protected VersionConflictListener |
versionConflictListener |
Constructor and Description |
---|
FSTObjectInput() |
FSTObjectInput(FSTConfiguration conf) |
FSTObjectInput(InputStream in)
Creates a FSTObjectInput that uses the specified
underlying InputStream.
|
FSTObjectInput(InputStream in,
FSTConfiguration conf)
Creates a FSTObjectInput that uses the specified
underlying InputStream.
|
public static boolean REGISTER_ENUMS_READ
public static ByteArrayInputStream emptyStream
protected FSTDecoder codec
protected FSTObjectRegistry objects
protected int curDepth
protected ArrayList<FSTObjectInput.CallbackEntry> callbacks
protected boolean ignoreAnnotations
protected FSTClazzInfoRegistry clInfoRegistry
protected FSTObjectInput.ConditionalCallback conditionalCallback
protected int readExternalReadAHead
protected VersionConflictListener versionConflictListener
protected FSTConfiguration conf
protected boolean isCrossPlatform
protected FSTClazzInfo.FSTFieldInfo infoCache
protected boolean closed
protected FSTObjectInput.MyObjectStream fakeWrapper
public FSTObjectInput() throws IOException
IOException
public FSTObjectInput(FSTConfiguration conf)
public FSTObjectInput(InputStream in) throws IOException
in
- the specified input streamIOException
public FSTObjectInput(InputStream in, FSTConfiguration conf)
in
- the specified input streampublic FSTConfiguration getConf()
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public byte readByte() throws IOException
readByte
in interface DataInput
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public short readShort() throws IOException
readShort
in interface DataInput
IOException
public int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public char readChar() throws IOException
readChar
in interface DataInput
IOException
public int readInt() throws IOException
readInt
in interface DataInput
IOException
public long readLong() throws IOException
readLong
in interface DataInput
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public String readLine() throws IOException
readLine
in interface DataInput
IOException
public String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public FSTDecoder getCodec()
protected void setCodec(FSTDecoder codec)
public Class getClassForName(String name) throws ClassNotFoundException
ClassNotFoundException
protected void initRegistries(FSTConfiguration conf)
public FSTObjectInput.ConditionalCallback getConditionalCallback()
public void setConditionalCallback(FSTObjectInput.ConditionalCallback conditionalCallback)
public int getReadExternalReadAHead()
public void setReadExternalReadAHead(int readExternalReadAHead)
readExternalReadAHead
- public Object readObject() throws ClassNotFoundException, IOException
readObject
in interface ObjectInput
ClassNotFoundException
IOException
public int read() throws IOException
read
in interface ObjectInput
IOException
public int read(byte[] b) throws IOException
read
in interface ObjectInput
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in interface ObjectInput
IOException
public long skip(long n) throws IOException
skip
in interface ObjectInput
IOException
public int available() throws IOException
available
in interface ObjectInput
IOException
protected void processValidation() throws InvalidObjectException
InvalidObjectException
public Object readObjectInternal(Class... expected) throws ClassNotFoundException, IOException, IllegalAccessException, InstantiationException
public Object readObjectWithHeader(FSTClazzInfo.FSTFieldInfo referencee) throws Exception
Exception
protected Object instantiateSpecialTag(FSTClazzInfo.FSTFieldInfo referencee, int readPos, byte code) throws Exception
Exception
protected FSTClazzInfo getClazzInfo(Class c, FSTClazzInfo.FSTFieldInfo referencee)
protected Object instantiateHandle(FSTClazzInfo.FSTFieldInfo referencee) throws IOException
IOException
protected Object instantiateArray(FSTClazzInfo.FSTFieldInfo referencee, int readPos) throws Exception
Exception
protected Object instantiateEnum(FSTClazzInfo.FSTFieldInfo referencee, int readPos) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
protected Object instantiateBigInt() throws IOException
IOException
protected Object instantiateAndReadWithSer(Class c, FSTObjectSerializer ser, FSTClazzInfo clzSerInfo, FSTClazzInfo.FSTFieldInfo referencee, int readPos) throws Exception
Exception
protected Object instantiateAndReadNoSer(Class c, FSTClazzInfo clzSerInfo, FSTClazzInfo.FSTFieldInfo referencee, int readPos) throws Exception
Exception
protected Object readObjectCompatible(FSTClazzInfo.FSTFieldInfo referencee, FSTClazzInfo serializationInfo, Object newObj) throws Exception
Exception
protected Object handleReadRessolve(FSTClazzInfo serializationInfo, Object newObj) throws IllegalAccessException
IllegalAccessException
protected void readObjectCompatibleRecursive(FSTClazzInfo.FSTFieldInfo referencee, Object toRead, FSTClazzInfo serializationInfo, Class cl) throws Exception
Exception
public void defaultReadObject(FSTClazzInfo.FSTFieldInfo referencee, FSTClazzInfo serializationInfo, Object newObj)
protected void readObjectFields(FSTClazzInfo.FSTFieldInfo referencee, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo[] fieldInfo, Object newObj, int startIndex, int version) throws Exception
Exception
public VersionConflictListener getVersionConflictListener()
public void setVersionConflictListener(VersionConflictListener versionConflictListener)
versionConflictListener
- protected void oldVersionRead(Object newObj)
protected void readFieldsMapBased(FSTClazzInfo.FSTFieldInfo referencee, FSTClazzInfo serializationInfo, Object newObj) throws Exception
Exception
protected boolean skipConditional(Object newObj, int conditional, FSTClazzInfo.FSTFieldInfo subInfo)
protected void readCompatibleObjectFields(FSTClazzInfo.FSTFieldInfo referencee, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo[] fieldInfo, Map res) throws Exception
Exception
public String readStringUTF() throws IOException
IOException
public String readStringAsc() throws IOException
IOException
protected Object readArray(FSTClazzInfo.FSTFieldInfo referencee) throws Exception
Exception
protected Object readArrayNoHeader(FSTClazzInfo.FSTFieldInfo referencee, int pos, Class arrCl) throws Exception
Exception
public void registerObject(Object o, int streamPosition, FSTClazzInfo info, FSTClazzInfo.FSTFieldInfo referencee)
public FSTClazzInfo readClass() throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
protected void resetAndClearRefs()
public void reset() throws IOException
IOException
public void resetForReuse(InputStream in) throws IOException
IOException
public void resetForReuseCopyArray(byte[] bytes, int off, int len) throws IOException
IOException
public void resetForReuseUseArray(byte[] bytes) throws IOException
IOException
public void resetForReuseUseArray(byte[] bytes, int len) throws IOException
IOException
public final int readFInt() throws IOException
IOException
public void close() throws IOException
close
in interface ObjectInput
close
in interface AutoCloseable
IOException
protected ObjectInputStream getObjectInputStream(Class cl, FSTClazzInfo clInfo, FSTClazzInfo.FSTFieldInfo referencee, Object toRead) throws IOException
IOException
protected void pushBack(int i)
Copyright © 2017. All rights reserved.