Package org.nustaq.serialization.coders
Class FSTJsonEncoder
java.lang.Object
org.nustaq.serialization.coders.FSTJsonEncoder
- All Implemented Interfaces:
FSTEncoder
Created by ruedi on 20/05/15.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
classToString
(Class clz) void
close()
close and flush to underlying stream if present.void
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[] outbytes) 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 outerObjectToWrite) 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 infoOrObject, long somValue, Object toWrite, FSTObjectOutput oout) void
writeVersionTag
(int version)
-
Field Details
-
gen
protected com.fasterxml.jackson.core.JsonGenerator gen
-
-
Constructor Details
-
FSTJsonEncoder
-
-
Method Details
-
setConf
- Specified by:
setConf
in interfaceFSTEncoder
-
writeRawBytes
- Specified by:
writeRawBytes
in interfaceFSTEncoder
- Throws:
IOException
-
writePrimitiveArray
Description copied from interface:FSTEncoder
does not write class tag and length- Specified by:
writePrimitiveArray
in interfaceFSTEncoder
- Throws:
IOException
-
writeStringUTF
- Specified by:
writeStringUTF
in interfaceFSTEncoder
- Throws:
IOException
-
writeFShort
- Specified by:
writeFShort
in interfaceFSTEncoder
- Throws:
IOException
-
writeFChar
- Specified by:
writeFChar
in interfaceFSTEncoder
- Throws:
IOException
-
writeFByte
- Specified by:
writeFByte
in interfaceFSTEncoder
- Throws:
IOException
-
writeFInt
- Specified by:
writeFInt
in interfaceFSTEncoder
- Throws:
IOException
-
writeFLong
- Specified by:
writeFLong
in interfaceFSTEncoder
- Throws:
IOException
-
writeFFloat
- Specified by:
writeFFloat
in interfaceFSTEncoder
- Throws:
IOException
-
writeFDouble
- Specified by:
writeFDouble
in interfaceFSTEncoder
- Throws:
IOException
-
getWritten
public int getWritten()- Specified by:
getWritten
in interfaceFSTEncoder
-
skip
public void skip(int i) - Specified by:
skip
in interfaceFSTEncoder
-
close
Description copied from interface:FSTEncoder
close and flush to underlying stream if present. The stream is also closed- Specified by:
close
in interfaceFSTEncoder
- Throws:
IOException
-
reset
public void reset(byte[] outbytes) - Specified by:
reset
in interfaceFSTEncoder
-
flush
Description copied from interface:FSTEncoder
resets stream (positions are lost)- Specified by:
flush
in interfaceFSTEncoder
- Throws:
IOException
-
writeInt32At
public void writeInt32At(int position, int v) Description copied from interface:FSTEncoder
used to write uncompressed int (guaranteed length = 4) at a (eventually recent) position- Specified by:
writeInt32At
in interfaceFSTEncoder
-
setOutstream
Description copied from interface:FSTEncoder
if output stream is null, just encode into a byte array- Specified by:
setOutstream
in interfaceFSTEncoder
-
createGenerator
- Throws:
IOException
-
ensureFree
- Specified by:
ensureFree
in interfaceFSTEncoder
- Throws:
IOException
-
getBuffer
public byte[] getBuffer()- Specified by:
getBuffer
in interfaceFSTEncoder
-
registerClass
- Specified by:
registerClass
in interfaceFSTEncoder
-
writeClass
- Specified by:
writeClass
in interfaceFSTEncoder
-
writeClass
- Specified by:
writeClass
in interfaceFSTEncoder
-
writeTag
public boolean writeTag(byte tag, Object infoOrObject, long somValue, Object toWrite, FSTObjectOutput oout) throws IOException - Specified by:
writeTag
in interfaceFSTEncoder
- Throws:
IOException
-
classToString
-
writeAttributeName
- Specified by:
writeAttributeName
in interfaceFSTEncoder
-
externalEnd
- Specified by:
externalEnd
in interfaceFSTEncoder
-
isWritingAttributes
public boolean isWritingAttributes()- Specified by:
isWritingAttributes
in interfaceFSTEncoder
-
isPrimitiveArray
- Specified by:
isPrimitiveArray
in interfaceFSTEncoder
-
isTagMultiDimSubArrays
public boolean isTagMultiDimSubArrays()- Specified by:
isTagMultiDimSubArrays
in interfaceFSTEncoder
-
writeVersionTag
- Specified by:
writeVersionTag
in interfaceFSTEncoder
- Throws:
IOException
-
isByteArrayBased
public boolean isByteArrayBased()- Specified by:
isByteArrayBased
in interfaceFSTEncoder
-
writeArrayEnd
public void writeArrayEnd()- Specified by:
writeArrayEnd
in interfaceFSTEncoder
-
writeFieldsEnd
- Specified by:
writeFieldsEnd
in interfaceFSTEncoder
-
getConf
- Specified by:
getConf
in interfaceFSTEncoder
-