Simplified the serialisation format. Other task #39.

The new format is simpler but less efficient for small integers, short
strings and short byte arrays.
This commit is contained in:
akwizgran
2014-01-14 22:40:47 +00:00
parent 8886d954d7
commit db96994d5c
15 changed files with 314 additions and 680 deletions

View File

@@ -14,37 +14,13 @@ public interface Reader {
boolean readBoolean() throws IOException;
void skipBoolean() throws IOException;
boolean hasUint7() throws IOException;
byte readUint7() throws IOException;
void skipUint7() throws IOException;
boolean hasInteger() throws IOException;
long readInteger() throws IOException;
void skipInteger() throws IOException;
boolean hasInt8() throws IOException;
byte readInt8() throws IOException;
void skipInt8() throws IOException;
boolean hasInt16() throws IOException;
short readInt16() throws IOException;
void skipInt16() throws IOException;
boolean hasInt32() throws IOException;
int readInt32() throws IOException;
void skipInt32() throws IOException;
boolean hasInt64() throws IOException;
long readInt64() throws IOException;
void skipInt64() throws IOException;
boolean hasIntAny() throws IOException;
long readIntAny() throws IOException;
void skipIntAny() throws IOException;
boolean hasFloat32() throws IOException;
float readFloat32() throws IOException;
void skipFloat32() throws IOException;
boolean hasFloat64() throws IOException;
double readFloat64() throws IOException;
void skipFloat64() throws IOException;
boolean hasFloat() throws IOException;
double readFloat() throws IOException;
void skipFloat() throws IOException;
boolean hasString() throws IOException;
String readString(int maxLength) throws IOException;

View File

@@ -13,17 +13,8 @@ public interface Writer {
void removeConsumer(Consumer c);
void writeBoolean(boolean b) throws IOException;
void writeUint7(byte b) throws IOException;
void writeInt8(byte b) throws IOException;
void writeInt16(short s) throws IOException;
void writeInt32(int i) throws IOException;
void writeInt64(long l) throws IOException;
void writeIntAny(long l) throws IOException;
void writeFloat32(float f) throws IOException;
void writeFloat64(double d) throws IOException;
void writeInteger(long l) throws IOException;
void writeFloat(double d) throws IOException;
void writeString(String s) throws IOException;
void writeBytes(byte[] b) throws IOException;