/** * Reads a null * * <pre> * N * </pre> */ public void readNull() throws IOException { int tag = read(); switch (tag) { case 'N': return; default: throw expect("null", tag); } }
/** * Reads a null * * <pre> * N * </pre> */ public void readNull() throws IOException { int tag = read(); switch (tag) { case 'N': return; default: throw expect("null", tag); } }
/** * Reads a null * * <pre> * N * </pre> */ public void readNull() throws IOException { int tag = read(); switch (tag) { case 'N': return; default: throw expect("null", tag); } }
/** * Reads a null * * <pre> * N * </pre> */ public void readNull() throws IOException { int tag = read(); switch (tag) { case 'N': return; default: throw expect("null", tag); } }
/** * Reads a fault. */ private HashMap readFault() throws IOException { HashMap map = new HashMap(); int code = read(); for (; code > 0 && code != 'z'; code = read()) { _peek = code; Object key = readObject(); Object value = readObject(); if (key != null && value != null) map.put(key, value); } if (code != 'z') throw expect("fault", code); return map; }
/** * Reads a fault. */ private HashMap readFault() throws IOException { HashMap map = new HashMap(); int code = read(); for (; code > 0 && code != 'z'; code = read()) { _peek = code; Object key = readObject(); Object value = readObject(); if (key != null && value != null) map.put(key, value); } if (code != 'z') throw expect("fault", code); return map; }
/** * Reads a fault. */ private HashMap readFault() throws IOException { HashMap map = new HashMap(); int code = read(); for (; code > 0 && code != 'z'; code = read()) { _peek = code; Object key = readObject(); Object value = readObject(); if (key != null && value != null) map.put(key, value); } if (code != 'z') throw expect("fault", code); return map; }
/** * Reads a fault. */ private HashMap readFault() throws IOException { HashMap map = new HashMap(); int code = read(); for (; code > 0 && code != 'z'; code = read()) { _peek = code; Object key = readObject(); Object value = readObject(); if (key != null && value != null) map.put(key, value); } if (code != 'z') throw expect("fault", code); return map; }
/** * Reads an integer * * <pre> * I b32 b24 b16 b8 * </pre> */ public int readInt() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (int) parseLong(); case 'D': return (int) parseDouble(); default: throw expect("int", tag); } }
/** * Reads an integer * * <pre> * I b32 b24 b16 b8 * </pre> */ public int readInt() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (int) parseLong(); case 'D': return (int) parseDouble(); default: throw expect("int", tag); } }
/** * Reads a double * * <pre> * D b64 b56 b48 b40 b32 b24 b16 b8 * </pre> */ public double readDouble() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (double) parseLong(); case 'D': return parseDouble(); default: throw expect("long", tag); } }
/** * Reads a boolean * * <pre> * T * F * </pre> */ public boolean readBoolean() throws IOException { int tag = read(); switch (tag) { case 'T': return true; case 'F': return false; case 'I': return parseInt() == 0; case 'L': return parseLong() == 0; case 'D': return parseDouble() == 0.0; case 'N': return false; default: throw expect("boolean", tag); } }
/** * Reads a long * * <pre> * L b64 b56 b48 b40 b32 b24 b16 b8 * </pre> */ public long readLong() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return parseLong(); case 'D': return (long) parseDouble(); default: throw expect("long", tag); } }
/** * Reads a long * * <pre> * L b64 b56 b48 b40 b32 b24 b16 b8 * </pre> */ public long readLong() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return parseLong(); case 'D': return (long) parseDouble(); default: throw expect("long", tag); } }
/** * Reads a long * * <pre> * L b64 b56 b48 b40 b32 b24 b16 b8 * </pre> */ public long readLong() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return parseLong(); case 'D': return (long) parseDouble(); default: throw expect("long", tag); } }
/** * Reads a double * * <pre> * D b64 b56 b48 b40 b32 b24 b16 b8 * </pre> */ public double readDouble() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (double) parseLong(); case 'D': return parseDouble(); default: throw expect("long", tag); } }
/** * Reads a double * * <pre> * D b64 b56 b48 b40 b32 b24 b16 b8 * </pre> */ public double readDouble() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (double) parseLong(); case 'D': return parseDouble(); default: throw expect("long", tag); } }
/** * Reads an integer * * <pre> * I b32 b24 b16 b8 * </pre> */ public int readInt() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (int) parseLong(); case 'D': return (int) parseDouble(); default: throw expect("int", tag); } }
/** * Reads an XML node. * * <pre> * S b16 b8 string value * </pre> */ public org.w3c.dom.Node readNode() throws IOException { int tag = read(); switch (tag) { case 'N': return null; case 'S': case 's': case 'X': case 'x': _isLastChunk = tag == 'S' || tag == 'X'; _chunkLength = (read() << 8) + read(); throw error("Can't handle string in this context"); default: throw expect("string", tag); } }
/** * Reads a byte from the underlying stream. */ private int parseByte() throws IOException { while (_chunkLength <= 0) { if (_isLastChunk) { return -1; } int code = read(); switch (code) { case 'b': _isLastChunk = false; _chunkLength = (read() << 8) + read(); break; case 'B': _isLastChunk = true; _chunkLength = (read() << 8) + read(); break; default: throw expect("byte[]", code); } } _chunkLength--; return read(); }