public int readUnsignedByte() throws IOException { return mDelegate.readUnsignedByte(); }
@Override public int readUnsignedByte() { try { return input.readUnsignedByte(); } catch (IOException e) { throw new IllegalStateException(e); } }
public int readUnsignedByte() throws IOException { return mDelegate.readUnsignedByte(); }
@Override public int readUnsignedByte() { try { return input.readUnsignedByte(); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public int readUnsignedByte() { try { return input.readUnsignedByte(); } catch (IOException e) { throw new IllegalStateException(e); } }
static OfYear readFrom(DataInput in) throws IOException { return new OfYear((char)in.readUnsignedByte(), (int)in.readUnsignedByte(), (int)in.readByte(), (int)in.readUnsignedByte(), in.readBoolean(), (int)readMillis(in)); }
static OfYear readFrom(DataInput in) throws IOException { return new OfYear((char)in.readUnsignedByte(), (int)in.readUnsignedByte(), (int)in.readByte(), (int)in.readUnsignedByte(), in.readBoolean(), (int)readMillis(in)); }
private final int _decodeUtf8_2(int c) throws IOException { int d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } return ((c & 0x1F) << 6) | (d & 0x3F); }
private final void _skipUtf8_2() throws IOException { int c = _inputData.readUnsignedByte(); if ((c & 0xC0) != 0x080) { _reportInvalidOther(c & 0xFF); } }
private final void _skipUtf8_3() throws IOException { //c &= 0x0F; int c = _inputData.readUnsignedByte(); if ((c & 0xC0) != 0x080) { _reportInvalidOther(c & 0xFF); } c = _inputData.readUnsignedByte(); if ((c & 0xC0) != 0x080) { _reportInvalidOther(c & 0xFF); } }
private final int _decodeUtf8_2(int c) throws IOException { int d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } return ((c & 0x1F) << 6) | (d & 0x3F); }
private final void _skipUtf8_2() throws IOException { int c = _inputData.readUnsignedByte(); if ((c & 0xC0) != 0x080) { _reportInvalidOther(c & 0xFF); } }
private final void _skipUtf8_3() throws IOException { //c &= 0x0F; int c = _inputData.readUnsignedByte(); if ((c & 0xC0) != 0x080) { _reportInvalidOther(c & 0xFF); } c = _inputData.readUnsignedByte(); if ((c & 0xC0) != 0x080) { _reportInvalidOther(c & 0xFF); } }
protected final void _matchToken(String matchStr, int i) throws IOException { final int len = matchStr.length(); do { int ch = _inputData.readUnsignedByte(); if (ch != matchStr.charAt(i)) { _reportInvalidToken(ch, matchStr.substring(0, i)); } } while (++i < len); int ch = _inputData.readUnsignedByte(); if (ch >= '0' && ch != ']' && ch != '}') { // expected/allowed chars _checkMatchEnd(matchStr, i, ch); } _nextByte = ch; }
private final int _decodeUtf8_3(int c1) throws IOException { c1 &= 0x0F; int d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } int c = (c1 << 6) | (d & 0x3F); d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } c = (c << 6) | (d & 0x3F); return c; }
private final void _skipUtf8_4() throws IOException { int d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } d = _inputData.readUnsignedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF); } }
public void testReadUnsignedByte_eof() throws IOException { DataInput in = new LittleEndianDataInputStream(new ByteArrayInputStream(new byte[0])); try { in.readUnsignedByte(); fail(); } catch (EOFException expected) { } }
private final void _skipComment() throws IOException { if (!isEnabled(Feature.ALLOW_COMMENTS)) { _reportUnexpectedChar('/', "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"); } int c = _inputData.readUnsignedByte(); if (c == '/') { _skipLine(); } else if (c == '*') { _skipCComment(); } else { _reportUnexpectedChar(c, "was expecting either '*' or '/' for a comment"); } }
private final void _skipComment() throws IOException { if (!isEnabled(Feature.ALLOW_COMMENTS)) { _reportUnexpectedChar('/', "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"); } int c = _inputData.readUnsignedByte(); if (c == '/') { _skipLine(); } else if (c == '*') { _skipCComment(); } else { _reportUnexpectedChar(c, "was expecting either '*' or '/' for a comment"); } }
public void testReadLittleEndian() throws IOException { DataInput in = new LittleEndianDataInputStream(new ByteArrayInputStream(data)); /* Read in various values in LITTLE ENDIAN FORMAT */ byte[] b = new byte[2]; in.readFully(b); assertEquals(-100, b[0]); assertEquals(100, b[1]); assertEquals(true, in.readBoolean()); assertEquals(false, in.readBoolean()); assertEquals(100, in.readByte()); assertEquals(-100, in.readByte()); assertEquals(200, in.readUnsignedByte()); assertEquals('\u6100', in.readChar()); assertEquals(-12150, in.readShort()); assertEquals(20675, in.readUnsignedShort()); assertEquals(0xBEBAFECA, in.readInt()); assertEquals(0xBEBAFECAEFBEADDEL, in.readLong()); assertEquals("Herby Derby", in.readUTF()); assertEquals(0xBEBAFECA, Float.floatToIntBits(in.readFloat())); assertEquals(0xBEBAFECAEFBEADDEL, Double.doubleToLongBits(in.readDouble())); }