Package org.nustaq.serialization.coders
Class FSTMinBinDecoder
java.lang.Object
org.nustaq.serialization.coders.FSTMinBinDecoder
- All Implemented Interfaces:
FSTDecoder
public class FSTMinBinDecoder extends java.lang.Object implements FSTDecoder
Date: 02.04.2014
Time: 19:13
Deserializes from self describing binary MinBin format
-
Constructor Summary
Constructors Constructor Description FSTMinBinDecoder(FSTConfiguration conf) -
Method Summary
Modifier and Type Method Description intavailable()java.lang.ClassclassForName(java.lang.String name)voidclose()java.lang.ObjectcoerceElement(java.lang.Class arrType, java.lang.Object value)voidconsumeEndMarker()voidendFieldReading(java.lang.Object newObj)only called when reading named fieldsintensureReadAhead(int bytes)byte[]getBuffer()java.lang.ObjectgetDirectObject()intgetInputPos()intgetObjectHeaderLen()booleaninArray()return wether current stream is reading an object or sequence currently makes sense for MinBin and JSon only, only Json serializer actually has implemented itbooleanisEndMarker(java.lang.String s)booleanisMapBased()voidmoveTo(int position)voidpushBack(int bytes)voidreadArrayEnd(FSTClazzInfo clzSerInfo)java.lang.ClassreadArrayHeader()FSTClazzInforeadClass()voidreadExternalEnd()bytereadFByte()charreadFChar()doublereadFDouble()floatreadFFloat()intreadFInt()voidreadFIntArr(int len, int[] arr)longreadFLong()java.lang.ObjectreadFPrimitiveArray(java.lang.Object array, java.lang.Class componentType, int len)shortreadFShort()intreadIntByte()voidreadObjectEnd()bytereadObjectHeaderTag()voidreadPlainBytes(byte[] b, int off, int len)intreadPlainInt()java.lang.StringreadStringAsc()java.lang.StringreadStringUTF()intreadVersionTag()voidregisterClass(java.lang.Class possible)voidreset()voidresetToCopyOf(byte[] bytes, int off, int len)voidresetWith(byte[] bytes, int len)voidsetConf(FSTConfiguration conf)voidsetInputStream(java.io.InputStream in)voidskip(int n)voidstartFieldReading(java.lang.Object newObj)quirks for json unknown decoding.
-
Constructor Details
-
Method Details
-
setConf
- Specified by:
setConfin interfaceFSTDecoder
-
readStringUTF
public java.lang.String readStringUTF() throws java.io.IOException- Specified by:
readStringUTFin interfaceFSTDecoder- Throws:
java.io.IOException
-
readStringAsc
public java.lang.String readStringAsc() throws java.io.IOException- Specified by:
readStringAscin interfaceFSTDecoder- Throws:
java.io.IOException
-
readFPrimitiveArray
public java.lang.Object readFPrimitiveArray(java.lang.Object array, java.lang.Class componentType, int len)- Specified by:
readFPrimitiveArrayin interfaceFSTDecoder
-
readFIntArr
public void readFIntArr(int len, int[] arr) throws java.io.IOException- Specified by:
readFIntArrin interfaceFSTDecoder- Throws:
java.io.IOException
-
readFInt
public int readFInt() throws java.io.IOException- Specified by:
readFIntin interfaceFSTDecoder- Throws:
java.io.IOException
-
readFDouble
public double readFDouble() throws java.io.IOException- Specified by:
readFDoublein interfaceFSTDecoder- Throws:
java.io.IOException
-
readFFloat
public float readFFloat() throws java.io.IOException- Specified by:
readFFloatin interfaceFSTDecoder- Throws:
java.io.IOException
-
readFByte
public byte readFByte() throws java.io.IOException- Specified by:
readFBytein interfaceFSTDecoder- Throws:
java.io.IOException
-
readIntByte
public int readIntByte() throws java.io.IOException- Specified by:
readIntBytein interfaceFSTDecoder- Throws:
java.io.IOException
-
readFLong
public long readFLong() throws java.io.IOException- Specified by:
readFLongin interfaceFSTDecoder- Throws:
java.io.IOException
-
readFChar
public char readFChar() throws java.io.IOException- Specified by:
readFCharin interfaceFSTDecoder- Throws:
java.io.IOException
-
readFShort
public short readFShort() throws java.io.IOException- Specified by:
readFShortin interfaceFSTDecoder- Throws:
java.io.IOException
-
readPlainInt
public int readPlainInt() throws java.io.IOException- Specified by:
readPlainIntin interfaceFSTDecoder- Throws:
java.io.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
-
setInputStream
public void setInputStream(java.io.InputStream in)- Specified by:
setInputStreamin interfaceFSTDecoder
-
ensureReadAhead
public int ensureReadAhead(int bytes)- Specified by:
ensureReadAheadin interfaceFSTDecoder
-
reset
public void reset()- Specified by:
resetin interfaceFSTDecoder
-
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
-
getObjectHeaderLen
public int getObjectHeaderLen()- Specified by:
getObjectHeaderLenin interfaceFSTDecoder
-
readObjectHeaderTag
public byte readObjectHeaderTag() throws java.io.IOException- Specified by:
readObjectHeaderTagin interfaceFSTDecoder- Throws:
java.io.IOException
-
getDirectObject
public java.lang.Object getDirectObject()- Specified by:
getDirectObjectin interfaceFSTDecoder
-
readClass
- Specified by:
readClassin interfaceFSTDecoder- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
classForName
public java.lang.Class classForName(java.lang.String name) throws java.lang.ClassNotFoundException- Specified by:
classForNamein interfaceFSTDecoder- Throws:
java.lang.ClassNotFoundException
-
registerClass
public void registerClass(java.lang.Class possible)- 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
-
consumeEndMarker
public void consumeEndMarker()- Specified by:
consumeEndMarkerin interfaceFSTDecoder
-
readArrayHeader
public java.lang.Class readArrayHeader() throws java.lang.Exception- Specified by:
readArrayHeaderin interfaceFSTDecoder- Throws:
java.lang.Exception
-
readExternalEnd
public void readExternalEnd()- Specified by:
readExternalEndin interfaceFSTDecoder
-
isEndMarker
public boolean isEndMarker(java.lang.String s)- Specified by:
isEndMarkerin interfaceFSTDecoder
-
readVersionTag
public int readVersionTag() throws java.io.IOException- Specified by:
readVersionTagin interfaceFSTDecoder- Throws:
java.io.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
public java.lang.Object coerceElement(java.lang.Class arrType, java.lang.Object value)- 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
public void startFieldReading(java.lang.Object newObj)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
public void endFieldReading(java.lang.Object newObj)Description copied from interface:FSTDecoderonly called when reading named fields- Specified by:
endFieldReadingin interfaceFSTDecoder
-