Package org.nustaq.serialization.coders
Class FSTMinBinEncoder
java.lang.Object
org.nustaq.serialization.coders.FSTMinBinEncoder
- All Implemented Interfaces:
FSTEncoder
public class FSTMinBinEncoder extends java.lang.Object implements FSTEncoder
Date: 30.03.2014
Time: 18:47
serializes into self describing binary format MinBin
-
Constructor Summary
Constructors Constructor Description FSTMinBinEncoder(FSTConfiguration conf) -
Method Summary
Modifier and Type Method Description protected java.lang.StringclassToString(java.lang.Class clz)voidclose()close and flush to underlying stream if present.voidensureFree(int bytes)voidexternalEnd(FSTClazzInfo clz)voidflush()resets stream (positions are lost)byte[]getBuffer()FSTConfigurationgetConf()intgetWritten()booleanisByteArrayBased()booleanisPrimitiveArray(java.lang.Object array, java.lang.Class<?> componentType)booleanisTagMultiDimSubArrays()booleanisWritingAttributes()voidregisterClass(java.lang.Class possible)voidreset(byte[] bytez)voidsetConf(FSTConfiguration conf)voidsetOutstream(java.io.OutputStream outstream)if output stream is null, just encode into a byte arrayvoidskip(int i)voidwriteArrayEnd()booleanwriteAttributeName(FSTClazzInfo.FSTFieldInfo subInfo, java.lang.Object value)voidwriteClass(java.lang.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(java.lang.Object array, int start, int length)does not write class tag and lengthvoidwriteRawBytes(byte[] bufferedName, int off, int length)voidwriteStringUTF(java.lang.String str)booleanwriteTag(byte tag, java.lang.Object infoOrObject, long somValue, java.lang.Object toWrite, FSTObjectOutput oout)voidwriteVersionTag(int version)
-
Constructor Details
-
Method Details
-
writeRawBytes
public void writeRawBytes(byte[] bufferedName, int off, int length) throws java.io.IOException- Specified by:
writeRawBytesin interfaceFSTEncoder- Throws:
java.io.IOException
-
setConf
- Specified by:
setConfin interfaceFSTEncoder
-
writePrimitiveArray
public void writePrimitiveArray(java.lang.Object array, int start, int length) throws java.io.IOExceptiondoes not write class tag and length- Specified by:
writePrimitiveArrayin interfaceFSTEncoder- Parameters:
array-start-length-- Throws:
java.io.IOException
-
writeStringUTF
public void writeStringUTF(java.lang.String str) throws java.io.IOException- Specified by:
writeStringUTFin interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFShort
public void writeFShort(short c) throws java.io.IOException- Specified by:
writeFShortin interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFChar
public void writeFChar(char c) throws java.io.IOException- Specified by:
writeFCharin interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFByte
public void writeFByte(int v) throws java.io.IOException- Specified by:
writeFBytein interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFInt
public void writeFInt(int anInt) throws java.io.IOException- Specified by:
writeFIntin interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFLong
public void writeFLong(long anInt) throws java.io.IOException- Specified by:
writeFLongin interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFFloat
public void writeFFloat(float value) throws java.io.IOException- Specified by:
writeFFloatin interfaceFSTEncoder- Throws:
java.io.IOException
-
writeFDouble
public void writeFDouble(double value) throws java.io.IOException- Specified by:
writeFDoublein interfaceFSTEncoder- Throws:
java.io.IOException
-
getWritten
public int getWritten()- Specified by:
getWrittenin interfaceFSTEncoder
-
skip
public void skip(int i)- Specified by:
skipin interfaceFSTEncoder
-
close
public void close() throws java.io.IOExceptionclose and flush to underlying stream if present. The stream is also closed- Specified by:
closein interfaceFSTEncoder- Throws:
java.io.IOException
-
reset
public void reset(byte[] bytez)- Specified by:
resetin interfaceFSTEncoder
-
flush
public void flush() throws java.io.IOExceptionresets stream (positions are lost)- Specified by:
flushin interfaceFSTEncoder- Throws:
java.io.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
public void setOutstream(java.io.OutputStream outstream)if output stream is null, just encode into a byte array- Specified by:
setOutstreamin interfaceFSTEncoder- Parameters:
outstream-
-
ensureFree
public void ensureFree(int bytes) throws java.io.IOException- Specified by:
ensureFreein interfaceFSTEncoder- Throws:
java.io.IOException
-
getBuffer
public byte[] getBuffer()- Specified by:
getBufferin interfaceFSTEncoder
-
registerClass
public void registerClass(java.lang.Class possible)- Specified by:
registerClassin interfaceFSTEncoder
-
writeClass
public void writeClass(java.lang.Class cl)- Specified by:
writeClassin interfaceFSTEncoder
-
writeClass
- Specified by:
writeClassin interfaceFSTEncoder
-
writeAttributeName
- Specified by:
writeAttributeNamein interfaceFSTEncoder
-
writeTag
public boolean writeTag(byte tag, java.lang.Object infoOrObject, long somValue, java.lang.Object toWrite, FSTObjectOutput oout) throws java.io.IOException- Specified by:
writeTagin interfaceFSTEncoder- Throws:
java.io.IOException
-
classToString
protected java.lang.String classToString(java.lang.Class clz) -
externalEnd
- Specified by:
externalEndin interfaceFSTEncoder
-
isWritingAttributes
public boolean isWritingAttributes()- Specified by:
isWritingAttributesin interfaceFSTEncoder
-
isPrimitiveArray
public boolean isPrimitiveArray(java.lang.Object array, java.lang.Class<?> componentType)- Specified by:
isPrimitiveArrayin interfaceFSTEncoder
-
isTagMultiDimSubArrays
public boolean isTagMultiDimSubArrays()- Specified by:
isTagMultiDimSubArraysin interfaceFSTEncoder
-
writeVersionTag
public void writeVersionTag(int version) throws java.io.IOException- Specified by:
writeVersionTagin interfaceFSTEncoder- Throws:
java.io.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
-