Read and write user-defined tags.

This commit is contained in:
akwizgran
2011-07-18 16:46:03 +01:00
parent 8fc97157d3
commit 427142ae51
7 changed files with 83 additions and 21 deletions

View File

@@ -56,4 +56,7 @@ public interface Reader {
boolean hasNull() throws IOException;
void readNull() throws IOException;
boolean hasUserDefinedTag() throws IOException;
int readUserDefinedTag() throws IOException;
}

View File

@@ -19,12 +19,13 @@ public interface Tag {
public static final byte END = -15; // 1111 0001
public static final byte NULL = -16; // 1111 0000
public static final byte USER = -32; // 1110 0000
public static final int SHORT_MASK = 0xF0; // Match first four bits
public static final int SHORT_STRING = 0x80; // 1000 xxxx
public static final int SHORT_RAW = 0x90; // 1001 xxxx
public static final int SHORT_LIST = 0xA0; // 1010 xxxx
public static final int SHORT_MAP = 0xB0; // 1011 xxxx
public static final int USER_MASK = 0xE0; // Match first three bits
public static final int USER = 0xC0; // 110x xxxx
public static final byte USER_EXT = -32; // 1110 0000
public static final int SHORT_USER_MASK = 0xE0; // Match first three bits
public static final int SHORT_USER = 0xC0; // 110x xxxx
}

View File

@@ -34,4 +34,6 @@ public interface Writer {
void writeMapEnd() throws IOException;
void writeNull() throws IOException;
void writeUserDefinedTag(int tag) throws IOException;
}