private void writeScheme(final ByteBuf buf, final AsciiString scheme) { if (scheme.equals(SCHEME_HTTP)) { Hpack.writeIndexedHeaderField(buf, 6); } else if (scheme.equals(SCHEME_HTTPS)) { Hpack.writeIndexedHeaderField(buf, 7); } else { writeLiteralHeaderFieldIncrementalIndexingIndexedName(buf, 2); writeString(buf, scheme); } }
private void writePath(final ByteBuf buf, final AsciiString path) { if (path.equals(PATH_SLASH)) { Hpack.writeIndexedHeaderField(buf, 4); } else if (path.equals(PATH_INDEX_HTML)) { Hpack.writeIndexedHeaderField(buf, 5); } else { writeLiteralHeaderFieldIncrementalIndexingIndexedName(buf, 4); writeString(buf, path); } }
private void writeMethod(final ByteBuf buf, final AsciiString method) { if (method.equals(HttpMethod.GET.asciiName())) { Hpack.writeIndexedHeaderField(buf, 2); } else if (method.equals(HttpMethod.POST.asciiName())) { Hpack.writeIndexedHeaderField(buf, 3); } else { writeLiteralHeaderFieldIncrementalIndexingIndexedName(buf, 2); writeString(buf, method); } }