Package org.nustaq.serialization
Interface FSTEncoder
- All Known Implementing Classes:
FSTBytezEncoder,FSTJsonEncoder,FSTMinBinEncoder,FSTStreamEncoder
public interface FSTEncoder
Created by ruedi on 27.03.14.
-
Method Summary
Modifier and Type Method Description 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[] out)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 info, long somValue, java.lang.Object toWrite, FSTObjectOutput oout)voidwriteVersionTag(int version)
-
Method Details
-
setConf
-
writeRawBytes
void writeRawBytes(byte[] bufferedName, int off, int length) throws java.io.IOException- Throws:
java.io.IOException
-
writePrimitiveArray
void writePrimitiveArray(java.lang.Object array, int start, int length) throws java.io.IOExceptiondoes not write class tag and length- Parameters:
array-- Throws:
java.io.IOException
-
writeStringUTF
void writeStringUTF(java.lang.String str) throws java.io.IOException- Throws:
java.io.IOException
-
writeFShort
void writeFShort(short c) throws java.io.IOException- Throws:
java.io.IOException
-
writeFChar
void writeFChar(char c) throws java.io.IOException- Throws:
java.io.IOException
-
writeFByte
void writeFByte(int v) throws java.io.IOException- Throws:
java.io.IOException
-
writeFInt
void writeFInt(int anInt) throws java.io.IOException- Throws:
java.io.IOException
-
writeFLong
void writeFLong(long anInt) throws java.io.IOException- Throws:
java.io.IOException
-
writeFFloat
void writeFFloat(float value) throws java.io.IOException- Throws:
java.io.IOException
-
writeFDouble
void writeFDouble(double value) throws java.io.IOException- Throws:
java.io.IOException
-
getWritten
int getWritten() -
skip
void skip(int i) -
close
void close() throws java.io.IOExceptionclose and flush to underlying stream if present. The stream is also closed- Throws:
java.io.IOException
-
reset
void reset(byte[] out) -
flush
void flush() throws java.io.IOExceptionresets stream (positions are lost)- Throws:
java.io.IOException
-
writeInt32At
void writeInt32At(int position, int v)used to write uncompressed int (guaranteed length = 4) at a (eventually recent) position- Parameters:
position-v-
-
setOutstream
void setOutstream(java.io.OutputStream outstream)if output stream is null, just encode into a byte array- Parameters:
outstream-
-
ensureFree
void ensureFree(int bytes) throws java.io.IOException- Throws:
java.io.IOException
-
getBuffer
byte[] getBuffer() -
registerClass
void registerClass(java.lang.Class possible) -
writeClass
void writeClass(java.lang.Class cl) -
writeClass
-
writeTag
boolean writeTag(byte tag, java.lang.Object info, long somValue, java.lang.Object toWrite, FSTObjectOutput oout) throws java.io.IOException- Throws:
java.io.IOException
-
writeAttributeName
-
externalEnd
-
isWritingAttributes
boolean isWritingAttributes() -
isPrimitiveArray
boolean isPrimitiveArray(java.lang.Object array, java.lang.Class<?> componentType) -
isTagMultiDimSubArrays
boolean isTagMultiDimSubArrays() -
writeVersionTag
void writeVersionTag(int version) throws java.io.IOException- Throws:
java.io.IOException
-
isByteArrayBased
boolean isByteArrayBased() -
writeArrayEnd
void writeArrayEnd() -
writeFieldsEnd
-
getConf
FSTConfiguration getConf()
-