if (fhcrc) updateCrc(source.buffer(), 0, 10); short id1id2 = source.readShort(); checkEqual("ID1ID2", (short) 0x1f8b, id1id2); source.skip(8);
frameLength = source.readShort() & 0xffffL; // Value is unsigned. } else if (frameLength == PAYLOAD_LONG) { frameLength = source.readLong();
throw new ProtocolException(); int port = fromSource.readShort() & 0xffff;
@Test public void readShortTooShortThrows() throws IOException { sink.writeShort(Short.MAX_VALUE); sink.emit(); source.readByte(); try { source.readShort(); fail(); } catch (EOFException expected) { } }
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { int id = source.readShort() & 0xFFFF; int value = source.readInt();
@Test public void readShortSplitAcrossMultipleSegments() throws Exception { sink.writeUtf8(repeat('a', SEGMENT_SIZE - 1)); sink.write(new byte[] { (byte) 0xab, (byte) 0xcd }); sink.emit(); source.skip(SEGMENT_SIZE - 1); assertEquals((short) 0xabcd, source.readShort()); assertTrue(source.exhausted()); }
frameLength = source.readShort() & 0xffffL; // Value is unsigned. } else if (frameLength == PAYLOAD_LONG) { frameLength = source.readLong();
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { int id = source.readShort() & 0xFFFF; int value = source.readInt();
private void readSynStream(Handler handler, int flags, int length) throws IOException { int w1 = source.readInt(); int w2 = source.readInt(); int streamId = w1 & 0x7fffffff; int associatedStreamId = w2 & 0x7fffffff; source.readShort(); // int priority = (s3 & 0xe000) >>> 13; int slot = s3 & 0xff; List<Header> headerBlock = headerBlockReader.readNameValueBlock(length - 10); boolean inFinished = (flags & FLAG_FIN) != 0; boolean outFinished = (flags & FLAG_UNIDIRECTIONAL) != 0; handler.headers(outFinished, inFinished, streamId, associatedStreamId, headerBlock, HeadersMode.SPDY_SYN_STREAM); }
private void readSynStream(Handler handler, int flags, int length) throws IOException { int w1 = source.readInt(); int w2 = source.readInt(); int streamId = w1 & 0x7fffffff; int associatedStreamId = w2 & 0x7fffffff; source.readShort(); // int priority = (s3 & 0xe000) >>> 13; int slot = s3 & 0xff; List<Header> headerBlock = headerBlockReader.readNameValueBlock(length - 10); boolean inFinished = (flags & FLAG_FIN) != 0; boolean outFinished = (flags & FLAG_UNIDIRECTIONAL) != 0; handler.headers(outFinished, inFinished, streamId, associatedStreamId, headerBlock, HeadersMode.SPDY_SYN_STREAM); }
private void readSynStream(Handler handler, int flags, int length) throws IOException { int w1 = source.readInt(); int w2 = source.readInt(); int streamId = w1 & 0x7fffffff; int associatedStreamId = w2 & 0x7fffffff; source.readShort(); // int priority = (s3 & 0xe000) >>> 13; int slot = s3 & 0xff; List<Header> headerBlock = headerBlockReader.readNameValueBlock(length - 10); boolean inFinished = (flags & FLAG_FIN) != 0; boolean outFinished = (flags & FLAG_UNIDIRECTIONAL) != 0; handler.headers(outFinished, inFinished, streamId, associatedStreamId, headerBlock, HeadersMode.SPDY_SYN_STREAM); }
frameLength = source.readShort() & 0xffffL; // Value is unsigned. } else if (frameLength == PAYLOAD_LONG) { frameLength = source.readLong();
frameLength = source.readShort() & 0xffffL; // Value is unsigned. } else if (frameLength == PAYLOAD_LONG) { frameLength = source.readLong();
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { short id = source.readShort(); int value = source.readInt();
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { short id = source.readShort(); int value = source.readInt();
frameLength = source.readShort() & 0xffffL; // Value is unsigned. } else if (frameLength == PAYLOAD_LONG) { frameLength = source.readLong();
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { short id = source.readShort(); int value = source.readInt();
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { int id = source.readShort() & 0xFFFF; int value = source.readInt();
Settings settings = new Settings(); for (int i = 0; i < length; i += 6) { int id = source.readShort() & 0xFFFF; int value = source.readInt();