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(Object array, Class<?> componentType)booleanisTagMultiDimSubArrays()booleanisWritingAttributes()voidregisterClass(Class possible)voidreset(byte[] out)voidsetConf(FSTConfiguration conf)voidsetOutstream(OutputStream outstream)if output stream is null, just encode into a byte arrayvoidskip(int i)voidwriteArrayEnd()booleanwriteAttributeName(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 info, long somValue, Object toWrite, FSTObjectOutput oout)voidwriteVersionTag(int version)
-
Method Details
-
setConf
-
writeRawBytes
- Throws:
IOException
-
writePrimitiveArray
does not write class tag and length- Parameters:
array-- Throws:
IOException
-
writeStringUTF
- Throws:
IOException
-
writeFShort
- Throws:
IOException
-
writeFChar
- Throws:
IOException
-
writeFByte
- Throws:
IOException
-
writeFInt
- Throws:
IOException
-
writeFLong
- Throws:
IOException
-
writeFFloat
- Throws:
IOException
-
writeFDouble
- Throws:
IOException
-
getWritten
int getWritten() -
skip
void skip(int i) -
close
close and flush to underlying stream if present. The stream is also closed- Throws:
IOException
-
reset
void reset(byte[] out) -
flush
resets stream (positions are lost)- Throws:
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
if output stream is null, just encode into a byte array- Parameters:
outstream-
-
ensureFree
- Throws:
IOException
-
getBuffer
byte[] getBuffer() -
registerClass
-
writeClass
-
writeClass
-
writeTag
boolean writeTag(byte tag, Object info, long somValue, Object toWrite, FSTObjectOutput oout) throws IOException- Throws:
IOException
-
writeAttributeName
-
externalEnd
-
isWritingAttributes
boolean isWritingAttributes() -
isPrimitiveArray
-
isTagMultiDimSubArrays
boolean isTagMultiDimSubArrays() -
writeVersionTag
- Throws:
IOException
-
isByteArrayBased
boolean isByteArrayBased() -
writeArrayEnd
void writeArrayEnd() -
writeFieldsEnd
-
getConf
FSTConfiguration getConf()
-