if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
/** * Sets the response body to {@code body}, chunked every {@code maxChunkSize} bytes. */ public MockResponse setChunkedBody(Buffer body, int maxChunkSize) { removeHeader("Content-Length"); headers.add(CHUNKED_BODY_HEADER); Buffer bytesOut = new Buffer(); while (!body.exhausted()) { long chunkSize = Math.min(body.size(), maxChunkSize); bytesOut.writeHexadecimalUnsignedLong(chunkSize); bytesOut.writeUtf8("\r\n"); bytesOut.write(body, chunkSize); bytesOut.writeUtf8("\r\n"); } bytesOut.writeUtf8("0\r\n"); // Last chunk. Trailers follow! this.body = bytesOut; return this; }
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
@Override public BufferedSink writeHexadecimalUnsignedLong(long v) throws IOException { if (closed) throw new IllegalStateException("closed"); buffer.writeHexadecimalUnsignedLong(v); return emitCompleteSegments(); }
Buffer buffer = new Buffer().writeHexadecimalUnsignedLong(value).writeByte(b); throw new NumberFormatException("Number too large: " + buffer.readUtf8());
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
if (i > 0) result.writeByte(':'); int group = (address[i] & 0xff) << 8 | address[i + 1] & 0xff; result.writeHexadecimalUnsignedLong(group); i += 2;
/** * Sets the response body to {@code body}, chunked every {@code maxChunkSize} * bytes. */ public MockResponse setChunkedBody(Buffer body, int maxChunkSize) { removeHeader("Content-Length"); headers.add(CHUNKED_BODY_HEADER); Buffer bytesOut = new Buffer(); while (!body.exhausted()) { long chunkSize = Math.min(body.size(), maxChunkSize); bytesOut.writeHexadecimalUnsignedLong(chunkSize); bytesOut.writeUtf8("\r\n"); bytesOut.write(body, chunkSize); bytesOut.writeUtf8("\r\n"); } bytesOut.writeUtf8("0\r\n\r\n"); // Last chunk + empty trailer + CRLF. this.body = bytesOut; return this; }
/** * Sets the response body to {@code body}, chunked every {@code maxChunkSize} bytes. */ public MockResponse setChunkedBody(Buffer body, int maxChunkSize) { removeHeader("Content-Length"); headers.add(CHUNKED_BODY_HEADER); Buffer bytesOut = new Buffer(); while (!body.exhausted()) { long chunkSize = Math.min(body.size(), maxChunkSize); bytesOut.writeHexadecimalUnsignedLong(chunkSize); bytesOut.writeUtf8("\r\n"); bytesOut.write(body, chunkSize); bytesOut.writeUtf8("\r\n"); } bytesOut.writeUtf8("0\r\n\r\n"); // Last chunk + empty trailer + CRLF. this.body = bytesOut; return this; }