Package org.nustaq.serialization.coders
Class FSTMinBinEncoder
java.lang.Object
org.nustaq.serialization.coders.FSTMinBinEncoder
- All Implemented Interfaces:
FSTEncoder
Date: 30.03.2014
Time: 18:47
serializes into self describing binary format MinBin
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
classToString
(Class clz) void
close()
close and flush to underlying stream if present.void
ensureFree
(int bytes) void
externalEnd
(FSTClazzInfo clz) void
flush()
resets stream (positions are lost)byte[]
getConf()
int
boolean
boolean
isPrimitiveArray
(Object array, Class<?> componentType) boolean
boolean
void
registerClass
(Class possible) void
reset
(byte[] bytez) void
setConf
(FSTConfiguration conf) void
setOutstream
(OutputStream outstream) if output stream is null, just encode into a byte arrayvoid
skip
(int i) void
boolean
writeAttributeName
(FSTClazzInfo.FSTFieldInfo subInfo, Object value) void
writeClass
(Class cl) void
writeClass
(FSTClazzInfo clInf) void
writeFByte
(int v) void
writeFChar
(char c) void
writeFDouble
(double value) void
writeFFloat
(float value) void
writeFieldsEnd
(FSTClazzInfo serializationInfo) void
writeFInt
(int anInt) void
writeFLong
(long anInt) void
writeFShort
(short c) void
writeInt32At
(int position, int v) used to write uncompressed int (guaranteed length = 4) at a (eventually recent) positionvoid
writePrimitiveArray
(Object array, int start, int length) does not write class tag and lengthvoid
writeRawBytes
(byte[] bufferedName, int off, int length) void
writeStringUTF
(String str) boolean
writeTag
(byte tag, Object infoOrObject, long somValue, Object toWrite, FSTObjectOutput oout) void
writeVersionTag
(int version)
-
Constructor Details
-
FSTMinBinEncoder
-
-
Method Details
-
writeRawBytes
- Specified by:
writeRawBytes
in interfaceFSTEncoder
- Throws:
IOException
-
setConf
- Specified by:
setConf
in interfaceFSTEncoder
-
writePrimitiveArray
does not write class tag and length- Specified by:
writePrimitiveArray
in interfaceFSTEncoder
- Parameters:
array
-start
-length
-- Throws:
IOException
-
writeStringUTF
- Specified by:
writeStringUTF
in interfaceFSTEncoder
- Throws:
IOException
-
writeFShort
- Specified by:
writeFShort
in interfaceFSTEncoder
- Throws:
IOException
-
writeFChar
- Specified by:
writeFChar
in interfaceFSTEncoder
- Throws:
IOException
-
writeFByte
- Specified by:
writeFByte
in interfaceFSTEncoder
- Throws:
IOException
-
writeFInt
- Specified by:
writeFInt
in interfaceFSTEncoder
- Throws:
IOException
-
writeFLong
- Specified by:
writeFLong
in interfaceFSTEncoder
- Throws:
IOException
-
writeFFloat
- Specified by:
writeFFloat
in interfaceFSTEncoder
- Throws:
IOException
-
writeFDouble
- Specified by:
writeFDouble
in interfaceFSTEncoder
- Throws:
IOException
-
getWritten
public int getWritten()- Specified by:
getWritten
in interfaceFSTEncoder
-
skip
public void skip(int i) - Specified by:
skip
in interfaceFSTEncoder
-
close
close and flush to underlying stream if present. The stream is also closed- Specified by:
close
in interfaceFSTEncoder
- Throws:
IOException
-
reset
public void reset(byte[] bytez) - Specified by:
reset
in interfaceFSTEncoder
-
flush
resets stream (positions are lost)- Specified by:
flush
in interfaceFSTEncoder
- Throws:
IOException
-
writeInt32At
public void writeInt32At(int position, int v) used to write uncompressed int (guaranteed length = 4) at a (eventually recent) position- Specified by:
writeInt32At
in interfaceFSTEncoder
- Parameters:
position
-v
-
-
setOutstream
if output stream is null, just encode into a byte array- Specified by:
setOutstream
in interfaceFSTEncoder
- Parameters:
outstream
-
-
ensureFree
- Specified by:
ensureFree
in interfaceFSTEncoder
- Throws:
IOException
-
getBuffer
public byte[] getBuffer()- Specified by:
getBuffer
in interfaceFSTEncoder
-
registerClass
- Specified by:
registerClass
in interfaceFSTEncoder
-
writeClass
- Specified by:
writeClass
in interfaceFSTEncoder
-
writeClass
- Specified by:
writeClass
in interfaceFSTEncoder
-
writeAttributeName
- Specified by:
writeAttributeName
in interfaceFSTEncoder
-
writeTag
public boolean writeTag(byte tag, Object infoOrObject, long somValue, Object toWrite, FSTObjectOutput oout) throws IOException - Specified by:
writeTag
in interfaceFSTEncoder
- Throws:
IOException
-
classToString
-
externalEnd
- Specified by:
externalEnd
in interfaceFSTEncoder
-
isWritingAttributes
public boolean isWritingAttributes()- Specified by:
isWritingAttributes
in interfaceFSTEncoder
-
isPrimitiveArray
- Specified by:
isPrimitiveArray
in interfaceFSTEncoder
-
isTagMultiDimSubArrays
public boolean isTagMultiDimSubArrays()- Specified by:
isTagMultiDimSubArrays
in interfaceFSTEncoder
-
writeVersionTag
- Specified by:
writeVersionTag
in interfaceFSTEncoder
- Throws:
IOException
-
isByteArrayBased
public boolean isByteArrayBased()- Specified by:
isByteArrayBased
in interfaceFSTEncoder
-
writeArrayEnd
public void writeArrayEnd()- Specified by:
writeArrayEnd
in interfaceFSTEncoder
-
writeFieldsEnd
- Specified by:
writeFieldsEnd
in interfaceFSTEncoder
-
getConf
- Specified by:
getConf
in interfaceFSTEncoder
-