@Test public void testStringChar(){ String val = "abc"; BitWriter writer = new BitWriter(); writer.write(val); BitReader reader = new BitReader(writer.extract()); char a = reader.readChar(); char b = reader.readChar(); char c = reader.readChar(); assertEquals('a', a); assertEquals('b', b); assertEquals('c', c); }
public char readChar(){ int x; byte a = readByte(); x = a & 0xFF; byte b = readByte(); x = x << 8; x |= (b & 0xFF); return (char) x; }
BitReader { public char readChar(){ int x; byte a = readByte(); x = a & 0xFF; byte b = readByte(); x = x << 8; x |= (b & 0xFF); return (char) x; } }
BitReader { public char readChar(){ int x; byte a = readByte(); x = a & 0xFF; byte b = readByte(); x = x << 8; x |= (b & 0xFF); return (char) x; } BitReader(byte[] data); }
BitReader { public char readChar(){ int x; byte a = readByte(); x = a & 0xFF; byte b = readByte(); x = x << 8; x |= (b & 0xFF); return (char) x; } BitReader(byte[] data); byte readByte(); boolean readBoolean(); int readInt(); int readInt(int nbits); char readChar(); }
BitReader { public char readChar(){ int x; byte a = readByte(); x = a & 0xFF; byte b = readByte(); x = x << 8; x |= (b & 0xFF); return (char) x; } BitReader(byte[] data); byte readByte(); boolean readBoolean(); int readInt(); int readInt(int nbits); char readChar();  }