public abstract class Serializer<T> extends Object implements Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected Class |
cls |
protected String |
descriptor |
protected one.nio.serial.Origin |
origin |
protected long |
uid |
| Modifier | Constructor and Description |
|---|---|
protected |
Serializer(Class cls) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
calcSize(T obj,
CalcSizeStream css) |
Class<T> |
cls() |
byte[] |
code() |
static Object |
deserialize(byte[] data) |
boolean |
equals(Object obj) |
abstract T |
fromJson(JsonReader in) |
T |
fromString(String s) |
protected void |
generateUid() |
int |
hashCode() |
static byte[] |
persist(Object obj) |
abstract T |
read(DataStream in) |
void |
readExternal(ObjectInput in) |
static byte[] |
serialize(Object obj) |
static int |
sizeOf(Object obj) |
abstract void |
skip(DataStream in) |
void |
skipExternal(ObjectInput in) |
void |
toJson(StringBuilder sb) |
abstract void |
toJson(T obj,
StringBuilder builder) |
String |
toString() |
long |
uid() |
protected String |
uniqueName(String prefix) |
abstract void |
write(T obj,
DataStream out) |
void |
writeExternal(ObjectOutput out) |
protected String descriptor
protected long uid
protected Class cls
protected one.nio.serial.Origin origin
protected Serializer(Class cls)
public long uid()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void skipExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic byte[] code()
protected final void generateUid()
public void toJson(StringBuilder sb)
public abstract void calcSize(T obj, CalcSizeStream css) throws IOException
IOExceptionpublic abstract void write(T obj, DataStream out) throws IOException
IOExceptionpublic abstract T read(DataStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic abstract void skip(DataStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic abstract void toJson(T obj, StringBuilder builder) throws IOException
IOExceptionpublic abstract T fromJson(JsonReader in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic T fromString(String s) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic static int sizeOf(Object obj) throws IOException
IOExceptionpublic static byte[] serialize(Object obj) throws IOException
IOExceptionpublic static byte[] persist(Object obj) throws IOException
IOExceptionpublic static Object deserialize(byte[] data) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2019. All rights reserved.