Package org.nustaq.serialization.coders
Class FSTStreamDecoder
java.lang.Object
org.nustaq.serialization.coders.FSTStreamDecoder
- All Implemented Interfaces:
FSTDecoder
Default Coder used for serialization. Decodes a binary stream written with FSTStreamEncoder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid_readFIntArr(int len, int[] arr) intclassForName(String name) voidclose()coerceElement(Class arrType, Object value) voidvoidendFieldReading(Object newObj) only called when reading named fieldsintensureReadAhead(int bytes) byte[]intintbooleaninArray()return wether current stream is reading an object or sequence currently makes sense for MinBin and JSon only, only Json serializer actually has implemented itbooleanbooleanvoidmoveTo(int position) voidpushBack(int bytes) voidreadArrayEnd(FSTClazzInfo clzSerInfo) voidfinal bytechardoublefloatReads a 4 byte float.intreadFInt()voidreadFIntArr(int len, int[] arr) longvoidreadFLongArr(int len, long[] arr) readFPrimitiveArray(Object array, Class componentType, int len) assumes class header+len already readshortfinal intvoidbytevoidreadPlainBytes(byte[] b, int off, int len) intlen < 127 !!!!!intvoidregisterClass(Class possible) voidreset()voidresetToCopyOf(byte[] bytes, int off, int len) voidresetWith(byte[] bytes, int len) voidsetConf(FSTConfiguration conf) voidvoidskip(int n) voidstartFieldReading(Object newObj) quirks for json unknown decoding.
-
Field Details
-
clnames
-
-
Constructor Details
-
FSTStreamDecoder
-
-
Method Details
-
setConf
- Specified by:
setConfin interfaceFSTDecoder
-
ensureReadAhead
public int ensureReadAhead(int bytes) - Specified by:
ensureReadAheadin interfaceFSTDecoder
-
readStringUTF
- Specified by:
readStringUTFin interfaceFSTDecoder- Throws:
IOException
-
readObjectHeaderTag
- Specified by:
readObjectHeaderTagin interfaceFSTDecoder- Throws:
IOException
-
readStringAsc
len < 127 !!!!!- Specified by:
readStringAscin interfaceFSTDecoder- Returns:
- Throws:
IOException
-
readFPrimitiveArray
assumes class header+len already read- Specified by:
readFPrimitiveArrayin interfaceFSTDecoder- Parameters:
componentType-len-- Returns:
-
_readFIntArr
- Throws:
IOException
-
readFIntArr
- Specified by:
readFIntArrin interfaceFSTDecoder- Throws:
IOException
-
readFLongArr
- Throws:
IOException
-
readFInt
- Specified by:
readFIntin interfaceFSTDecoder- Throws:
IOException
-
readFDouble
- Specified by:
readFDoublein interfaceFSTDecoder- Throws:
IOException
-
readFFloat
Reads a 4 byte float.- Specified by:
readFFloatin interfaceFSTDecoder- Throws:
IOException
-
readFByte
- Specified by:
readFBytein interfaceFSTDecoder- Throws:
IOException
-
readIntByte
- Specified by:
readIntBytein interfaceFSTDecoder- Throws:
IOException
-
readFLong
- Specified by:
readFLongin interfaceFSTDecoder- Throws:
IOException
-
readFChar
- Specified by:
readFCharin interfaceFSTDecoder- Throws:
IOException
-
readFShort
- Specified by:
readFShortin interfaceFSTDecoder- Throws:
IOException
-
readPlainInt
- Specified by:
readPlainIntin interfaceFSTDecoder- Throws:
IOException
-
getBuffer
public byte[] getBuffer()- Specified by:
getBufferin interfaceFSTDecoder
-
getInputPos
public int getInputPos()- Specified by:
getInputPosin interfaceFSTDecoder
-
moveTo
public void moveTo(int position) - Specified by:
moveToin interfaceFSTDecoder
-
reset
public void reset()- Specified by:
resetin interfaceFSTDecoder
-
setInputStream
- Specified by:
setInputStreamin interfaceFSTDecoder
-
getInputStream
-
resetToCopyOf
public void resetToCopyOf(byte[] bytes, int off, int len) - Specified by:
resetToCopyOfin interfaceFSTDecoder
-
resetWith
public void resetWith(byte[] bytes, int len) - Specified by:
resetWithin interfaceFSTDecoder
-
readClass
- Specified by:
readClassin interfaceFSTDecoder- Throws:
IOExceptionClassNotFoundException
-
classForName
- Specified by:
classForNamein interfaceFSTDecoder- Throws:
ClassNotFoundException
-
registerClass
- Specified by:
registerClassin interfaceFSTDecoder
-
close
public void close()- Specified by:
closein interfaceFSTDecoder
-
skip
public void skip(int n) - Specified by:
skipin interfaceFSTDecoder
-
readPlainBytes
public void readPlainBytes(byte[] b, int off, int len) - Specified by:
readPlainBytesin interfaceFSTDecoder
-
isMapBased
public boolean isMapBased()- Specified by:
isMapBasedin interfaceFSTDecoder
-
getDirectObject
- Specified by:
getDirectObjectin interfaceFSTDecoder
-
getObjectHeaderLen
public int getObjectHeaderLen()- Specified by:
getObjectHeaderLenin interfaceFSTDecoder
-
consumeEndMarker
public void consumeEndMarker()- Specified by:
consumeEndMarkerin interfaceFSTDecoder
-
readArrayHeader
- Specified by:
readArrayHeaderin interfaceFSTDecoder- Throws:
Exception
-
readExternalEnd
public void readExternalEnd()- Specified by:
readExternalEndin interfaceFSTDecoder
-
isEndMarker
- Specified by:
isEndMarkerin interfaceFSTDecoder
-
readVersionTag
- Specified by:
readVersionTagin interfaceFSTDecoder- Throws:
IOException
-
pushBack
public void pushBack(int bytes) - Specified by:
pushBackin interfaceFSTDecoder
-
readArrayEnd
- Specified by:
readArrayEndin interfaceFSTDecoder
-
readObjectEnd
public void readObjectEnd()- Specified by:
readObjectEndin interfaceFSTDecoder
-
coerceElement
- Specified by:
coerceElementin interfaceFSTDecoder
-
available
public int available()- Specified by:
availablein interfaceFSTDecoder- Returns:
- a value > 0 if more bytes are available
-
inArray
public boolean inArray()Description copied from interface:FSTDecoderreturn wether current stream is reading an object or sequence currently makes sense for MinBin and JSon only, only Json serializer actually has implemented it- Specified by:
inArrayin interfaceFSTDecoder- Returns:
-
startFieldReading
Description copied from interface:FSTDecoderquirks for json unknown decoding. Need a hook to set original classname only called when reading named fields- Specified by:
startFieldReadingin interfaceFSTDecoder
-
endFieldReading
Description copied from interface:FSTDecoderonly called when reading named fields- Specified by:
endFieldReadingin interfaceFSTDecoder
-