public class QuickSerializer
extends java.lang.Object
A simple tool for quick serialization of some data types.
Warning: you should not pass incorrect strings in writeString, writeStrings, writeStrings2d methods. Here incorrect String means a string containing malformed surrogate char elements, as described at http://java.sun.com/j2se/1.5.0/docs/api/java/io/OutputStreamWriter.html Such strings may damage the serialized file.
Modifier and Type | Field and Description |
---|---|
static int |
AQS_VERSION |
static TextIO |
TEXT_IO |
Constructor and Description |
---|
QuickSerializer() |
QuickSerializer(char[] data) |
QuickSerializer(java.io.File file) |
QuickSerializer(java.lang.String fileName) |
Modifier and Type | Method and Description |
---|---|
char[] |
getData() |
int |
length() |
int |
offset() |
boolean |
readBoolean() |
int |
readInt() |
long |
readLong() |
java.lang.String |
readString() |
java.lang.String[] |
readStrings() |
java.lang.String[][] |
readStrings2d() |
void |
save(java.io.File file) |
void |
save(java.lang.String fileName) |
int |
version() |
void |
writeBoolean(boolean v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeString(java.lang.String v) |
void |
writeStrings(java.lang.String[] v) |
void |
writeStrings2d(java.lang.String[][] v) |
public static final int AQS_VERSION
public static final TextIO TEXT_IO
public QuickSerializer(char[] data)
public QuickSerializer(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public QuickSerializer(java.io.File file) throws java.io.IOException
java.io.IOException
public QuickSerializer()
public int offset()
public int length()
public char[] getData()
public void save(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void save(java.io.File file) throws java.io.IOException
java.io.IOException
public int version()
public boolean readBoolean()
public void writeBoolean(boolean v)
public int readInt()
public void writeInt(int v)
public long readLong()
public void writeLong(long v)
public java.lang.String readString()
public void writeString(java.lang.String v)
public java.lang.String[] readStrings()
public void writeStrings(java.lang.String[] v)
public java.lang.String[][] readStrings2d()
public void writeStrings2d(java.lang.String[][] v)