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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringclassToString(Class clz) voidclose()close and flush to underlying stream if present.voidensureFree(int bytes) voidexternalEnd(FSTClazzInfo clz) voidflush()resets stream (positions are lost)byte[]getConf()intbooleanbooleanisPrimitiveArray(Object array, Class<?> componentType) booleanbooleanvoidregisterClass(Class possible) voidreset(byte[] bytez) voidsetConf(FSTConfiguration conf) voidsetOutstream(OutputStream outstream) if output stream is null, just encode into a byte arrayvoidskip(int i) voidbooleanwriteAttributeName(FSTClazzInfo.FSTFieldInfo subInfo, Object value) voidwriteClass(Class cl) voidwriteClass(FSTClazzInfo clInf) voidwriteFByte(int v) voidwriteFChar(char c) voidwriteFDouble(double value) voidwriteFFloat(float value) voidwriteFieldsEnd(FSTClazzInfo serializationInfo) voidwriteFInt(int anInt) voidwriteFLong(long anInt) voidwriteFShort(short c) voidwriteInt32At(int position, int v) used to write uncompressed int (guaranteed length = 4) at a (eventually recent) positionvoidwritePrimitiveArray(Object array, int start, int length) does not write class tag and lengthvoidwriteRawBytes(byte[] bufferedName, int off, int length) voidwriteStringUTF(String str) booleanwriteTag(byte tag, Object infoOrObject, long somValue, Object toWrite, FSTObjectOutput oout) voidwriteVersionTag(int version)
-
Constructor Details
-
FSTMinBinEncoder
-
-
Method Details
-
writeRawBytes
- Specified by:
writeRawBytesin interfaceFSTEncoder- Throws:
IOException
-
setConf
- Specified by:
setConfin interfaceFSTEncoder
-
writePrimitiveArray
does not write class tag and length- Specified by:
writePrimitiveArrayin interfaceFSTEncoder- Parameters:
array-start-length-- Throws:
IOException
-
writeStringUTF
- Specified by:
writeStringUTFin interfaceFSTEncoder- Throws:
IOException
-
writeFShort
- Specified by:
writeFShortin interfaceFSTEncoder- Throws:
IOException
-
writeFChar
- Specified by:
writeFCharin interfaceFSTEncoder- Throws:
IOException
-
writeFByte
- Specified by:
writeFBytein interfaceFSTEncoder- Throws:
IOException
-
writeFInt
- Specified by:
writeFIntin interfaceFSTEncoder- Throws:
IOException
-
writeFLong
- Specified by:
writeFLongin interfaceFSTEncoder- Throws:
IOException
-
writeFFloat
- Specified by:
writeFFloatin interfaceFSTEncoder- Throws:
IOException
-
writeFDouble
- Specified by:
writeFDoublein interfaceFSTEncoder- Throws:
IOException
-
getWritten
public int getWritten()- Specified by:
getWrittenin interfaceFSTEncoder
-
skip
public void skip(int i) - Specified by:
skipin interfaceFSTEncoder
-
close
close and flush to underlying stream if present. The stream is also closed- Specified by:
closein interfaceFSTEncoder- Throws:
IOException
-
reset
public void reset(byte[] bytez) - Specified by:
resetin interfaceFSTEncoder
-
flush
resets stream (positions are lost)- Specified by:
flushin 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:
writeInt32Atin interfaceFSTEncoder- Parameters:
position-v-
-
setOutstream
if output stream is null, just encode into a byte array- Specified by:
setOutstreamin interfaceFSTEncoder- Parameters:
outstream-
-
ensureFree
- Specified by:
ensureFreein interfaceFSTEncoder- Throws:
IOException
-
getBuffer
public byte[] getBuffer()- Specified by:
getBufferin interfaceFSTEncoder
-
registerClass
- Specified by:
registerClassin interfaceFSTEncoder
-
writeClass
- Specified by:
writeClassin interfaceFSTEncoder
-
writeClass
- Specified by:
writeClassin interfaceFSTEncoder
-
writeAttributeName
- Specified by:
writeAttributeNamein interfaceFSTEncoder
-
writeTag
public boolean writeTag(byte tag, Object infoOrObject, long somValue, Object toWrite, FSTObjectOutput oout) throws IOException - Specified by:
writeTagin interfaceFSTEncoder- Throws:
IOException
-
classToString
-
externalEnd
- Specified by:
externalEndin interfaceFSTEncoder
-
isWritingAttributes
public boolean isWritingAttributes()- Specified by:
isWritingAttributesin interfaceFSTEncoder
-
isPrimitiveArray
- Specified by:
isPrimitiveArrayin interfaceFSTEncoder
-
isTagMultiDimSubArrays
public boolean isTagMultiDimSubArrays()- Specified by:
isTagMultiDimSubArraysin interfaceFSTEncoder
-
writeVersionTag
- Specified by:
writeVersionTagin interfaceFSTEncoder- Throws:
IOException
-
isByteArrayBased
public boolean isByteArrayBased()- Specified by:
isByteArrayBasedin interfaceFSTEncoder
-
writeArrayEnd
public void writeArrayEnd()- Specified by:
writeArrayEndin interfaceFSTEncoder
-
writeFieldsEnd
- Specified by:
writeFieldsEndin interfaceFSTEncoder
-
getConf
- Specified by:
getConfin interfaceFSTEncoder
-