10501051105210531054105510561057105810591060
@Test public void pReadShort_void() throws Exception { try { Stream stream = new Stream(); stream.writeBit(1); for (short sh : sampleShorts()) { stream.writeShort(sh); }
10561057105810591060106110621063106410651066
for (short sh : sampleShorts()) { stream.writeShort(sh); } stream.writeBit(1); stream.readBit(); for (int i = 0; i < sampleShorts().length; i++) { assertEquals(sampleShorts()[i], stream.readShort());
10811082108310841085108610871088108910901091
} finally { } try { Stream stream = new Stream(); stream.writeBit(1); stream.readShort(); fail(); } catch (InsufficientBufferException ex) { } finally { }
11021103110411051106110711081109111011111112
@Test public void pReadUnsignedShort_void() throws Exception { try { Stream stream = new Stream(); stream.writeBit(1); for (short sh : sampleShorts()) { stream.writeShort(sh); }
11081109111011111112111311141115111611171118
for (short sh : sampleShorts()) { stream.writeShort(sh); } stream.writeBit(1); stream.readBit(); for (int i = 0; i < sampleShorts().length; i++) { assertEquals(sampleShorts()[i] & 0xffff, stream.readUnsignedShort());
11331134113511361137113811391140114111421143
} finally { } try { Stream stream = new Stream(); stream.writeBit(1); stream.readUnsignedShort(); fail(); } catch (InsufficientBufferException ex) { } finally { }
11541155115611571158115911601161116211631164
@Test public void pReadChar_void() throws Exception { try { Stream stream = new Stream(); stream.writeBit(1); for (char ch : sampleChars()) { stream.writeChar(ch); }
11601161116211631164116511661167116811691170
for (char ch : sampleChars()) { stream.writeChar(ch); } stream.writeBit(1); stream.readBit(); for (int i = 0; i < sampleChars().length; i++) { assertEquals(sampleChars()[i], stream.readChar());
11851186118711881189119011911192119311941195
} finally { } try { Stream stream = new Stream(); stream.writeBit(1); stream.readChar(); fail(); } catch (InsufficientBufferException ex) { } finally { }
12061207120812091210121112121213121412151216
@Test public void pReadInt_void() throws Exception { try { Stream stream = new Stream(); stream.writeBit(1); for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) { stream.writeInt(nwi.getNumber().intValue()); }