public class JavaBinCodec extends Object
Note -- Never re-use an instance of this class for more than one marshal or unmarshall operation. Always create a new instance.
| Modifier and Type | Class and Description |
|---|---|
static interface |
JavaBinCodec.ObjectResolver |
static class |
JavaBinCodec.StringBytes |
static class |
JavaBinCodec.StringCache |
| Modifier and Type | Field and Description |
|---|---|
static byte |
ARR |
static byte |
BOOL_FALSE |
static byte |
BOOL_TRUE |
static byte |
BYTE |
static byte |
BYTEARR |
protected FastOutputStream |
daos |
static byte |
DATE |
static byte |
DOUBLE |
static byte |
END |
protected static Object |
END_OBJ |
static byte |
ENUM_FIELD_VALUE |
static byte |
EXTERN_STRING |
static byte |
FLOAT |
static byte |
INT |
static byte |
ITERATOR |
static byte |
LONG |
static byte |
MAP |
static byte |
MAP_ENTRY |
static byte |
NAMED_LST |
static byte |
NULL |
static byte |
ORDERED_MAP |
static byte |
SHORT |
static byte |
SINT |
static byte |
SLONG |
static byte |
SOLRDOC |
static byte |
SOLRDOCLST |
static byte |
SOLRINPUTDOC |
static byte |
SOLRINPUTDOC_CHILDS |
static byte |
STR |
static byte |
TAG_AND_LEN |
protected byte |
tagByte |
| Constructor and Description |
|---|
JavaBinCodec() |
JavaBinCodec(JavaBinCodec.ObjectResolver resolver) |
JavaBinCodec(JavaBinCodec.ObjectResolver resolver,
JavaBinCodec.StringCache stringCache) |
public static final byte NULL
public static final byte BOOL_TRUE
public static final byte BOOL_FALSE
public static final byte BYTE
public static final byte SHORT
public static final byte DOUBLE
public static final byte INT
public static final byte LONG
public static final byte FLOAT
public static final byte DATE
public static final byte MAP
public static final byte SOLRDOC
public static final byte SOLRDOCLST
public static final byte BYTEARR
public static final byte ITERATOR
public static final byte END
public static final byte SOLRINPUTDOC
public static final byte SOLRINPUTDOC_CHILDS
public static final byte ENUM_FIELD_VALUE
public static final byte MAP_ENTRY
public static final byte TAG_AND_LEN
public static final byte STR
public static final byte SINT
public static final byte SLONG
public static final byte ARR
public static final byte ORDERED_MAP
public static final byte NAMED_LST
public static final byte EXTERN_STRING
protected FastOutputStream daos
protected static final Object END_OBJ
protected byte tagByte
public JavaBinCodec()
public JavaBinCodec(JavaBinCodec.ObjectResolver resolver)
public JavaBinCodec(JavaBinCodec.ObjectResolver resolver, JavaBinCodec.StringCache stringCache)
public JavaBinCodec.ObjectResolver getResolver()
public void marshal(Object nl, OutputStream os) throws IOException
IOExceptionpublic void init(FastOutputStream os)
public Object unmarshal(InputStream is) throws IOException
IOExceptionpublic SimpleOrderedMap<Object> readOrderedMap(DataInputInputStream dis) throws IOException
IOExceptionpublic NamedList<Object> readNamedList(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeNamedList(NamedList<?> nl) throws IOException
IOExceptionpublic void writeVal(Object val) throws IOException
IOExceptionpublic Object readVal(DataInputInputStream dis) throws IOException
IOExceptionpublic boolean writeKnownType(Object val) throws IOException
IOExceptionpublic void writeTag(byte tag)
throws IOException
IOExceptionpublic void writeTag(byte tag,
int size)
throws IOException
IOExceptionpublic void writeByteArray(byte[] arr,
int offset,
int len)
throws IOException
IOExceptionpublic byte[] readByteArray(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeSolrDocument(SolrDocument doc) throws IOException
IOExceptionpublic SolrDocument readSolrDocument(DataInputInputStream dis) throws IOException
IOExceptionpublic SolrDocumentList readSolrDocumentList(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeSolrDocumentList(SolrDocumentList docs) throws IOException
IOExceptionpublic SolrInputDocument readSolrInputDocument(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException
IOExceptionpublic Map<Object,Object> readMap(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeIterator(Iterator iter) throws IOException
IOExceptionpublic List<Object> readIterator(DataInputInputStream fis) throws IOException
IOExceptionpublic void writeArray(List l) throws IOException
IOExceptionpublic void writeArray(Collection coll) throws IOException
IOExceptionpublic void writeArray(Object[] arr) throws IOException
IOExceptionpublic List<Object> readArray(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeEnumFieldValue(EnumFieldValue enumFieldValue) throws IOException
EnumFieldValue as tag+int value+string valueenumFieldValue - to writeIOExceptionpublic void writeMapEntry(Map.Entry<Object,Object> val) throws IOException
IOExceptionpublic EnumFieldValue readEnumFieldValue(DataInputInputStream dis) throws IOException
EnumFieldValue (int+string) from input streamdis - data input streamEnumFieldValueIOExceptionpublic Map.Entry<Object,Object> readMapEntry(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeStr(String s) throws IOException
IOExceptionpublic String readStr(DataInputInputStream dis) throws IOException
IOExceptionpublic String readStr(DataInputInputStream dis, JavaBinCodec.StringCache stringCache) throws IOException
IOExceptionpublic void writeInt(int val)
throws IOException
IOExceptionpublic int readSmallInt(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeLong(long val)
throws IOException
IOExceptionpublic long readSmallLong(DataInputInputStream dis) throws IOException
IOExceptionpublic void writeFloat(float val)
throws IOException
IOExceptionpublic boolean writePrimitive(Object val) throws IOException
IOExceptionpublic void writeMap(Map<?,?> val) throws IOException
IOExceptionpublic int readSize(DataInputInputStream in) throws IOException
IOExceptionpublic static void writeVInt(int i,
FastOutputStream out)
throws IOException
IOException - If there is a low-level I/O error.public static int readVInt(DataInputInputStream in) throws IOException
writeVInt(int, FastOutputStream)IOException - If there is a low-level I/O error.public static void writeVLong(long i,
FastOutputStream out)
throws IOException
IOExceptionpublic static long readVLong(DataInputInputStream in) throws IOException
IOExceptionpublic void writeExternString(String s) throws IOException
IOExceptionpublic String readExternString(DataInputInputStream fis) throws IOException
IOExceptionCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.