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 TypeMethodDescriptionvoid
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[] out) 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 info, long somValue, Object toWrite, FSTObjectOutput oout) void
writeVersionTag
(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()
-