id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
122,600 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java | WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse | public static ChannelFuture sendUnsupportedVersionResponse(Channel channel, ChannelPromise promise) {
HttpResponse res = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1,
HttpResponseStatus.UPGRADE_REQUIRED);
res.headers().set(HttpHeaderNames.SEC_WEBSOCKET_VERSION, WebSo... | java | public static ChannelFuture sendUnsupportedVersionResponse(Channel channel, ChannelPromise promise) {
HttpResponse res = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1,
HttpResponseStatus.UPGRADE_REQUIRED);
res.headers().set(HttpHeaderNames.SEC_WEBSOCKET_VERSION, WebSo... | [
"public",
"static",
"ChannelFuture",
"sendUnsupportedVersionResponse",
"(",
"Channel",
"channel",
",",
"ChannelPromise",
"promise",
")",
"{",
"HttpResponse",
"res",
"=",
"new",
"DefaultFullHttpResponse",
"(",
"HttpVersion",
".",
"HTTP_1_1",
",",
"HttpResponseStatus",
".... | Return that we need cannot not support the web socket version | [
"Return",
"that",
"we",
"need",
"cannot",
"not",
"support",
"the",
"web",
"socket",
"version"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java#L157-L164 |
122,601 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/ReadOnlyHttp2Headers.java | ReadOnlyHttp2Headers.clientHeaders | public static ReadOnlyHttp2Headers clientHeaders(boolean validateHeaders,
AsciiString method, AsciiString path,
AsciiString scheme, AsciiString authority,
AsciiS... | java | public static ReadOnlyHttp2Headers clientHeaders(boolean validateHeaders,
AsciiString method, AsciiString path,
AsciiString scheme, AsciiString authority,
AsciiS... | [
"public",
"static",
"ReadOnlyHttp2Headers",
"clientHeaders",
"(",
"boolean",
"validateHeaders",
",",
"AsciiString",
"method",
",",
"AsciiString",
"path",
",",
"AsciiString",
"scheme",
",",
"AsciiString",
"authority",
",",
"AsciiString",
"...",
"otherHeaders",
")",
"{"... | Create a new read only representation of headers used by clients.
@param validateHeaders {@code true} will run validation on each header name/value pair to ensure protocol
compliance.
@param method The value for {@link PseudoHeaderName#METHOD}.
@param path The value for {@link PseudoHeaderName#PATH}.
@param scheme The ... | [
"Create",
"a",
"new",
"read",
"only",
"representation",
"of",
"headers",
"used",
"by",
"clients",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/ReadOnlyHttp2Headers.java#L83-L93 |
122,602 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/ReadOnlyHttp2Headers.java | ReadOnlyHttp2Headers.serverHeaders | public static ReadOnlyHttp2Headers serverHeaders(boolean validateHeaders,
AsciiString status,
AsciiString... otherHeaders) {
return new ReadOnlyHttp2Headers(validateHeaders,
... | java | public static ReadOnlyHttp2Headers serverHeaders(boolean validateHeaders,
AsciiString status,
AsciiString... otherHeaders) {
return new ReadOnlyHttp2Headers(validateHeaders,
... | [
"public",
"static",
"ReadOnlyHttp2Headers",
"serverHeaders",
"(",
"boolean",
"validateHeaders",
",",
"AsciiString",
"status",
",",
"AsciiString",
"...",
"otherHeaders",
")",
"{",
"return",
"new",
"ReadOnlyHttp2Headers",
"(",
"validateHeaders",
",",
"new",
"AsciiString",... | Create a new read only representation of headers used by servers.
@param validateHeaders {@code true} will run validation on each header name/value pair to ensure protocol
compliance.
@param status The value for {@link PseudoHeaderName#STATUS}.
@param otherHeaders A an array of key:value pairs. Must not contain any
<a ... | [
"Create",
"a",
"new",
"read",
"only",
"representation",
"of",
"headers",
"used",
"by",
"servers",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/ReadOnlyHttp2Headers.java#L107-L113 |
122,603 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2DivSufSort.java | Bzip2DivSufSort.bwt | public int bwt() {
final int[] SA = this.SA;
final byte[] T = this.T;
final int n = this.n;
final int[] bucketA = new int[BUCKET_A_SIZE];
final int[] bucketB = new int[BUCKET_B_SIZE];
if (n == 0) {
return 0;
}
if (n == 1) {
SA[0] ... | java | public int bwt() {
final int[] SA = this.SA;
final byte[] T = this.T;
final int n = this.n;
final int[] bucketA = new int[BUCKET_A_SIZE];
final int[] bucketB = new int[BUCKET_B_SIZE];
if (n == 0) {
return 0;
}
if (n == 1) {
SA[0] ... | [
"public",
"int",
"bwt",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"SA",
"=",
"this",
".",
"SA",
";",
"final",
"byte",
"[",
"]",
"T",
"=",
"this",
".",
"T",
";",
"final",
"int",
"n",
"=",
"this",
".",
"n",
";",
"final",
"int",
"[",
"]",
"buck... | Performs a Burrows Wheeler Transform on the input array.
@return the index of the first character of the input array within the output array | [
"Performs",
"a",
"Burrows",
"Wheeler",
"Transform",
"on",
"the",
"input",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2DivSufSort.java#L2095-L2116 |
122,604 | netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.addComponents | private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) {
if (buffers instanceof ByteBuf) {
// If buffers also implements ByteBuf (e.g. CompositeByteBuf), it has to go to addComponent(ByteBuf).
return addComponent(increaseIndex, cIndex, (ByteB... | java | private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) {
if (buffers instanceof ByteBuf) {
// If buffers also implements ByteBuf (e.g. CompositeByteBuf), it has to go to addComponent(ByteBuf).
return addComponent(increaseIndex, cIndex, (ByteB... | [
"private",
"CompositeByteBuf",
"addComponents",
"(",
"boolean",
"increaseIndex",
",",
"int",
"cIndex",
",",
"Iterable",
"<",
"ByteBuf",
">",
"buffers",
")",
"{",
"if",
"(",
"buffers",
"instanceof",
"ByteBuf",
")",
"{",
"// If buffers also implements ByteBuf (e.g. Comp... | but we do in the most common case that the Iterable is a Collection) | [
"but",
"we",
"do",
"in",
"the",
"most",
"common",
"case",
"that",
"the",
"Iterable",
"is",
"a",
"Collection",
")"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L488-L514 |
122,605 | netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.consolidateIfNeeded | private void consolidateIfNeeded() {
// Consolidate if the number of components will exceed the allowed maximum by the current
// operation.
int size = componentCount;
if (size > maxNumComponents) {
final int capacity = components[size - 1].endOffset;
ByteBuf con... | java | private void consolidateIfNeeded() {
// Consolidate if the number of components will exceed the allowed maximum by the current
// operation.
int size = componentCount;
if (size > maxNumComponents) {
final int capacity = components[size - 1].endOffset;
ByteBuf con... | [
"private",
"void",
"consolidateIfNeeded",
"(",
")",
"{",
"// Consolidate if the number of components will exceed the allowed maximum by the current",
"// operation.",
"int",
"size",
"=",
"componentCount",
";",
"if",
"(",
"size",
">",
"maxNumComponents",
")",
"{",
"final",
"... | This should only be called as last operation from a method as this may adjust the underlying
array of components and so affect the index etc. | [
"This",
"should",
"only",
"be",
"called",
"as",
"last",
"operation",
"from",
"a",
"method",
"as",
"this",
"may",
"adjust",
"the",
"underlying",
"array",
"of",
"components",
"and",
"so",
"affect",
"the",
"index",
"etc",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L520-L538 |
122,606 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanDecoder.java | HpackHuffmanDecoder.decode | public AsciiString decode(ByteBuf buf, int length) throws Http2Exception {
processor.reset();
buf.forEachByte(buf.readerIndex(), length, processor);
buf.skipBytes(length);
return processor.end();
} | java | public AsciiString decode(ByteBuf buf, int length) throws Http2Exception {
processor.reset();
buf.forEachByte(buf.readerIndex(), length, processor);
buf.skipBytes(length);
return processor.end();
} | [
"public",
"AsciiString",
"decode",
"(",
"ByteBuf",
"buf",
",",
"int",
"length",
")",
"throws",
"Http2Exception",
"{",
"processor",
".",
"reset",
"(",
")",
";",
"buf",
".",
"forEachByte",
"(",
"buf",
".",
"readerIndex",
"(",
")",
",",
"length",
",",
"proc... | Decompresses the given Huffman coded string literal.
@param buf the string literal to be decoded
@return the output stream for the compressed data
@throws Http2Exception EOS Decoded | [
"Decompresses",
"the",
"given",
"Huffman",
"coded",
"string",
"literal",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanDecoder.java#L65-L70 |
122,607 | netty/netty | codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java | ClassResolvers.weakCachingResolver | public static ClassResolver weakCachingResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new WeakReferenceMap<String, Class<?>>(new HashMap<String, Reference<Class<?>>>()));
} | java | public static ClassResolver weakCachingResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new WeakReferenceMap<String, Class<?>>(new HashMap<String, Reference<Class<?>>>()));
} | [
"public",
"static",
"ClassResolver",
"weakCachingResolver",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"new",
"CachingClassResolver",
"(",
"new",
"ClassLoaderClassResolver",
"(",
"defaultClassLoader",
"(",
"classLoader",
")",
")",
",",
"new",
"WeakReferenceM... | non-aggressive non-concurrent cache
good for non-shared default cache
@param classLoader - specific classLoader to use, or null if you want to revert to default
@return new instance of class resolver | [
"non",
"-",
"aggressive",
"non",
"-",
"concurrent",
"cache",
"good",
"for",
"non",
"-",
"shared",
"default",
"cache"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java#L41-L45 |
122,608 | netty/netty | codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java | ClassResolvers.softCachingResolver | public static ClassResolver softCachingResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new SoftReferenceMap<String, Class<?>>(new HashMap<String, Reference<Class<?>>>()));
} | java | public static ClassResolver softCachingResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new SoftReferenceMap<String, Class<?>>(new HashMap<String, Reference<Class<?>>>()));
} | [
"public",
"static",
"ClassResolver",
"softCachingResolver",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"new",
"CachingClassResolver",
"(",
"new",
"ClassLoaderClassResolver",
"(",
"defaultClassLoader",
"(",
"classLoader",
")",
")",
",",
"new",
"SoftReferenceM... | aggressive non-concurrent cache
good for non-shared cache, when we're not worried about class unloading
@param classLoader - specific classLoader to use, or null if you want to revert to default
@return new instance of class resolver | [
"aggressive",
"non",
"-",
"concurrent",
"cache",
"good",
"for",
"non",
"-",
"shared",
"cache",
"when",
"we",
"re",
"not",
"worried",
"about",
"class",
"unloading"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java#L54-L58 |
122,609 | netty/netty | codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java | ClassResolvers.weakCachingConcurrentResolver | public static ClassResolver weakCachingConcurrentResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new WeakReferenceMap<String, Class<?>>(
PlatformDependent.<String, Referenc... | java | public static ClassResolver weakCachingConcurrentResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new WeakReferenceMap<String, Class<?>>(
PlatformDependent.<String, Referenc... | [
"public",
"static",
"ClassResolver",
"weakCachingConcurrentResolver",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"new",
"CachingClassResolver",
"(",
"new",
"ClassLoaderClassResolver",
"(",
"defaultClassLoader",
"(",
"classLoader",
")",
")",
",",
"new",
"Weak... | non-aggressive concurrent cache
good for shared cache, when we're worried about class unloading
@param classLoader - specific classLoader to use, or null if you want to revert to default
@return new instance of class resolver | [
"non",
"-",
"aggressive",
"concurrent",
"cache",
"good",
"for",
"shared",
"cache",
"when",
"we",
"re",
"worried",
"about",
"class",
"unloading"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java#L67-L72 |
122,610 | netty/netty | codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java | ClassResolvers.softCachingConcurrentResolver | public static ClassResolver softCachingConcurrentResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new SoftReferenceMap<String, Class<?>>(
PlatformDependent.<String, Referenc... | java | public static ClassResolver softCachingConcurrentResolver(ClassLoader classLoader) {
return new CachingClassResolver(
new ClassLoaderClassResolver(defaultClassLoader(classLoader)),
new SoftReferenceMap<String, Class<?>>(
PlatformDependent.<String, Referenc... | [
"public",
"static",
"ClassResolver",
"softCachingConcurrentResolver",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"new",
"CachingClassResolver",
"(",
"new",
"ClassLoaderClassResolver",
"(",
"defaultClassLoader",
"(",
"classLoader",
")",
")",
",",
"new",
"Soft... | aggressive concurrent cache
good for shared cache, when we're not worried about class unloading
@param classLoader - specific classLoader to use, or null if you want to revert to default
@return new instance of class resolver | [
"aggressive",
"concurrent",
"cache",
"good",
"for",
"shared",
"cache",
"when",
"we",
"re",
"not",
"worried",
"about",
"class",
"unloading"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java#L81-L86 |
122,611 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoder.java | HttpPostRequestDecoder.isMultipart | public static boolean isMultipart(HttpRequest request) {
if (request.headers().contains(HttpHeaderNames.CONTENT_TYPE)) {
return getMultipartDataBoundary(request.headers().get(HttpHeaderNames.CONTENT_TYPE)) != null;
} else {
return false;
}
} | java | public static boolean isMultipart(HttpRequest request) {
if (request.headers().contains(HttpHeaderNames.CONTENT_TYPE)) {
return getMultipartDataBoundary(request.headers().get(HttpHeaderNames.CONTENT_TYPE)) != null;
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"isMultipart",
"(",
"HttpRequest",
"request",
")",
"{",
"if",
"(",
"request",
".",
"headers",
"(",
")",
".",
"contains",
"(",
"HttpHeaderNames",
".",
"CONTENT_TYPE",
")",
")",
"{",
"return",
"getMultipartDataBoundary",
"(",
"requ... | Check if the given request is a multipart request
@return True if the request is a Multipart request | [
"Check",
"if",
"the",
"given",
"request",
"is",
"a",
"multipart",
"request"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoder.java#L142-L148 |
122,612 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoder.java | HttpPostRequestDecoder.getMultipartDataBoundary | protected static String[] getMultipartDataBoundary(String contentType) {
// Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]"
String[] headerContentType = splitHeaderContentType(contentType);
final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.t... | java | protected static String[] getMultipartDataBoundary(String contentType) {
// Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]"
String[] headerContentType = splitHeaderContentType(contentType);
final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.t... | [
"protected",
"static",
"String",
"[",
"]",
"getMultipartDataBoundary",
"(",
"String",
"contentType",
")",
"{",
"// Check if Post using \"multipart/form-data; boundary=--89421926422648 [; charset=xxx]\"",
"String",
"[",
"]",
"headerContentType",
"=",
"splitHeaderContentType",
"(",... | Check from the request ContentType if this request is a Multipart request.
@return an array of String if multipartDataBoundary exists with the multipartDataBoundary
as first element, charset if any as second (missing if not set), else null | [
"Check",
"from",
"the",
"request",
"ContentType",
"if",
"this",
"request",
"is",
"a",
"Multipart",
"request",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoder.java#L155-L193 |
122,613 | netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContext.java | SslContext.newHandler | protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls, Executor executor) {
return new SslHandler(newEngine(alloc), startTls, executor);
} | java | protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls, Executor executor) {
return new SslHandler(newEngine(alloc), startTls, executor);
} | [
"protected",
"SslHandler",
"newHandler",
"(",
"ByteBufAllocator",
"alloc",
",",
"boolean",
"startTls",
",",
"Executor",
"executor",
")",
"{",
"return",
"new",
"SslHandler",
"(",
"newEngine",
"(",
"alloc",
")",
",",
"startTls",
",",
"executor",
")",
";",
"}"
] | Create a new SslHandler.
@see #newHandler(ByteBufAllocator, String, int, boolean, Executor) | [
"Create",
"a",
"new",
"SslHandler",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContext.java#L932-L934 |
122,614 | netty/netty | handler/src/main/java/io/netty/handler/logging/LoggingHandler.java | LoggingHandler.formatSimple | private static String formatSimple(ChannelHandlerContext ctx, String eventName, Object msg) {
String chStr = ctx.channel().toString();
String msgStr = String.valueOf(msg);
StringBuilder buf = new StringBuilder(chStr.length() + 1 + eventName.length() + 2 + msgStr.length());
return buf.app... | java | private static String formatSimple(ChannelHandlerContext ctx, String eventName, Object msg) {
String chStr = ctx.channel().toString();
String msgStr = String.valueOf(msg);
StringBuilder buf = new StringBuilder(chStr.length() + 1 + eventName.length() + 2 + msgStr.length());
return buf.app... | [
"private",
"static",
"String",
"formatSimple",
"(",
"ChannelHandlerContext",
"ctx",
",",
"String",
"eventName",
",",
"Object",
"msg",
")",
"{",
"String",
"chStr",
"=",
"ctx",
".",
"channel",
"(",
")",
".",
"toString",
"(",
")",
";",
"String",
"msgStr",
"="... | Generates the default log message of the specified event whose argument is an arbitrary object. | [
"Generates",
"the",
"default",
"log",
"message",
"of",
"the",
"specified",
"event",
"whose",
"argument",
"is",
"an",
"arbitrary",
"object",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java#L369-L374 |
122,615 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java | Cache.clear | final void clear() {
while (!resolveCache.isEmpty()) {
for (Iterator<Entry<String, Entries>> i = resolveCache.entrySet().iterator(); i.hasNext();) {
Map.Entry<String, Entries> e = i.next();
i.remove();
e.getValue().clearAndCancel();
}
... | java | final void clear() {
while (!resolveCache.isEmpty()) {
for (Iterator<Entry<String, Entries>> i = resolveCache.entrySet().iterator(); i.hasNext();) {
Map.Entry<String, Entries> e = i.next();
i.remove();
e.getValue().clearAndCancel();
}
... | [
"final",
"void",
"clear",
"(",
")",
"{",
"while",
"(",
"!",
"resolveCache",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"Entries",
">",
">",
"i",
"=",
"resolveCache",
".",
"entrySet",
"(",
")",
".",... | Remove everything from the cache. | [
"Remove",
"everything",
"from",
"the",
"cache",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java#L94-L103 |
122,616 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java | Cache.get | final List<? extends E> get(String hostname) {
Entries entries = resolveCache.get(hostname);
return entries == null ? null : entries.get();
} | java | final List<? extends E> get(String hostname) {
Entries entries = resolveCache.get(hostname);
return entries == null ? null : entries.get();
} | [
"final",
"List",
"<",
"?",
"extends",
"E",
">",
"get",
"(",
"String",
"hostname",
")",
"{",
"Entries",
"entries",
"=",
"resolveCache",
".",
"get",
"(",
"hostname",
")",
";",
"return",
"entries",
"==",
"null",
"?",
"null",
":",
"entries",
".",
"get",
... | Returns all caches entries for the given hostname. | [
"Returns",
"all",
"caches",
"entries",
"for",
"the",
"given",
"hostname",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java#L116-L119 |
122,617 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java | Cache.cache | final void cache(String hostname, E value, int ttl, EventLoop loop) {
Entries entries = resolveCache.get(hostname);
if (entries == null) {
entries = new Entries(hostname);
Entries oldEntries = resolveCache.putIfAbsent(hostname, entries);
if (oldEntries != null) {
... | java | final void cache(String hostname, E value, int ttl, EventLoop loop) {
Entries entries = resolveCache.get(hostname);
if (entries == null) {
entries = new Entries(hostname);
Entries oldEntries = resolveCache.putIfAbsent(hostname, entries);
if (oldEntries != null) {
... | [
"final",
"void",
"cache",
"(",
"String",
"hostname",
",",
"E",
"value",
",",
"int",
"ttl",
",",
"EventLoop",
"loop",
")",
"{",
"Entries",
"entries",
"=",
"resolveCache",
".",
"get",
"(",
"hostname",
")",
";",
"if",
"(",
"entries",
"==",
"null",
")",
... | Cache a value for the given hostname that will automatically expire once the TTL is reached. | [
"Cache",
"a",
"value",
"for",
"the",
"given",
"hostname",
"that",
"will",
"automatically",
"expire",
"once",
"the",
"TTL",
"is",
"reached",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java#L124-L134 |
122,618 | netty/netty | common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java | FastThreadLocal.get | @SuppressWarnings("unchecked")
public final V get() {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
Object v = threadLocalMap.indexedVariable(index);
if (v != InternalThreadLocalMap.UNSET) {
return (V) v;
}
return initialize(threadLocalMap... | java | @SuppressWarnings("unchecked")
public final V get() {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
Object v = threadLocalMap.indexedVariable(index);
if (v != InternalThreadLocalMap.UNSET) {
return (V) v;
}
return initialize(threadLocalMap... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"V",
"get",
"(",
")",
"{",
"InternalThreadLocalMap",
"threadLocalMap",
"=",
"InternalThreadLocalMap",
".",
"get",
"(",
")",
";",
"Object",
"v",
"=",
"threadLocalMap",
".",
"indexedVariable",
... | Returns the current value for the current thread | [
"Returns",
"the",
"current",
"value",
"for",
"the",
"current",
"thread"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java#L134-L143 |
122,619 | netty/netty | common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java | FastThreadLocal.set | public final void set(V value) {
if (value != InternalThreadLocalMap.UNSET) {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
setKnownNotUnset(threadLocalMap, value);
} else {
remove();
}
} | java | public final void set(V value) {
if (value != InternalThreadLocalMap.UNSET) {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
setKnownNotUnset(threadLocalMap, value);
} else {
remove();
}
} | [
"public",
"final",
"void",
"set",
"(",
"V",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"InternalThreadLocalMap",
".",
"UNSET",
")",
"{",
"InternalThreadLocalMap",
"threadLocalMap",
"=",
"InternalThreadLocalMap",
".",
"get",
"(",
")",
";",
"setKnownNotUnset",
... | Set the value for the current thread. | [
"Set",
"the",
"value",
"for",
"the",
"current",
"thread",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java#L190-L197 |
122,620 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.setOcspResponse | @UnstableApi
public void setOcspResponse(byte[] response) {
if (!enableOcsp) {
throw new IllegalStateException("OCSP stapling is not enabled");
}
if (clientMode) {
throw new IllegalStateException("Not a server SSLEngine");
}
synchronized (this) {
... | java | @UnstableApi
public void setOcspResponse(byte[] response) {
if (!enableOcsp) {
throw new IllegalStateException("OCSP stapling is not enabled");
}
if (clientMode) {
throw new IllegalStateException("Not a server SSLEngine");
}
synchronized (this) {
... | [
"@",
"UnstableApi",
"public",
"void",
"setOcspResponse",
"(",
"byte",
"[",
"]",
"response",
")",
"{",
"if",
"(",
"!",
"enableOcsp",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"OCSP stapling is not enabled\"",
")",
";",
"}",
"if",
"(",
"clientMod... | Sets the OCSP response. | [
"Sets",
"the",
"OCSP",
"response",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L388-L401 |
122,621 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.shutdown | public final synchronized void shutdown() {
if (DESTROYED_UPDATER.compareAndSet(this, 0, 1)) {
engineMap.remove(ssl);
SSL.freeSSL(ssl);
ssl = networkBIO = 0;
isInboundDone = outboundClosed = true;
}
// On shutdown clear all errors
SSL.cle... | java | public final synchronized void shutdown() {
if (DESTROYED_UPDATER.compareAndSet(this, 0, 1)) {
engineMap.remove(ssl);
SSL.freeSSL(ssl);
ssl = networkBIO = 0;
isInboundDone = outboundClosed = true;
}
// On shutdown clear all errors
SSL.cle... | [
"public",
"final",
"synchronized",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"DESTROYED_UPDATER",
".",
"compareAndSet",
"(",
"this",
",",
"0",
",",
"1",
")",
")",
"{",
"engineMap",
".",
"remove",
"(",
"ssl",
")",
";",
"SSL",
".",
"freeSSL",
"(",
... | Destroys this engine. | [
"Destroys",
"this",
"engine",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L487-L498 |
122,622 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.writePlaintextData | private int writePlaintextData(final ByteBuffer src, int len) {
final int pos = src.position();
final int limit = src.limit();
final int sslWrote;
if (src.isDirect()) {
sslWrote = SSL.writeToSSL(ssl, bufferAddress(src) + pos, len);
if (sslWrote > 0) {
... | java | private int writePlaintextData(final ByteBuffer src, int len) {
final int pos = src.position();
final int limit = src.limit();
final int sslWrote;
if (src.isDirect()) {
sslWrote = SSL.writeToSSL(ssl, bufferAddress(src) + pos, len);
if (sslWrote > 0) {
... | [
"private",
"int",
"writePlaintextData",
"(",
"final",
"ByteBuffer",
"src",
",",
"int",
"len",
")",
"{",
"final",
"int",
"pos",
"=",
"src",
".",
"position",
"(",
")",
";",
"final",
"int",
"limit",
"=",
"src",
".",
"limit",
"(",
")",
";",
"final",
"int... | Write plaintext data to the OpenSSL internal BIO
Calling this function with src.remaining == 0 is undefined. | [
"Write",
"plaintext",
"data",
"to",
"the",
"OpenSSL",
"internal",
"BIO"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L505-L534 |
122,623 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.writeEncryptedData | private ByteBuf writeEncryptedData(final ByteBuffer src, int len) {
final int pos = src.position();
if (src.isDirect()) {
SSL.bioSetByteBuffer(networkBIO, bufferAddress(src) + pos, len, false);
} else {
final ByteBuf buf = alloc.directBuffer(len);
try {
... | java | private ByteBuf writeEncryptedData(final ByteBuffer src, int len) {
final int pos = src.position();
if (src.isDirect()) {
SSL.bioSetByteBuffer(networkBIO, bufferAddress(src) + pos, len, false);
} else {
final ByteBuf buf = alloc.directBuffer(len);
try {
... | [
"private",
"ByteBuf",
"writeEncryptedData",
"(",
"final",
"ByteBuffer",
"src",
",",
"int",
"len",
")",
"{",
"final",
"int",
"pos",
"=",
"src",
".",
"position",
"(",
")",
";",
"if",
"(",
"src",
".",
"isDirect",
"(",
")",
")",
"{",
"SSL",
".",
"bioSetB... | Write encrypted data to the OpenSSL network BIO. | [
"Write",
"encrypted",
"data",
"to",
"the",
"OpenSSL",
"network",
"BIO",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L539-L561 |
122,624 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.readPlaintextData | private int readPlaintextData(final ByteBuffer dst) {
final int sslRead;
final int pos = dst.position();
if (dst.isDirect()) {
sslRead = SSL.readFromSSL(ssl, bufferAddress(dst) + pos, dst.limit() - pos);
if (sslRead > 0) {
dst.position(pos + sslRead);
... | java | private int readPlaintextData(final ByteBuffer dst) {
final int sslRead;
final int pos = dst.position();
if (dst.isDirect()) {
sslRead = SSL.readFromSSL(ssl, bufferAddress(dst) + pos, dst.limit() - pos);
if (sslRead > 0) {
dst.position(pos + sslRead);
... | [
"private",
"int",
"readPlaintextData",
"(",
"final",
"ByteBuffer",
"dst",
")",
"{",
"final",
"int",
"sslRead",
";",
"final",
"int",
"pos",
"=",
"dst",
".",
"position",
"(",
")",
";",
"if",
"(",
"dst",
".",
"isDirect",
"(",
")",
")",
"{",
"sslRead",
"... | Read plaintext data from the OpenSSL internal BIO | [
"Read",
"plaintext",
"data",
"from",
"the",
"OpenSSL",
"internal",
"BIO"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L566-L591 |
122,625 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.shutdownWithError | private SSLException shutdownWithError(String operations, int sslError) {
return shutdownWithError(operations, sslError, SSL.getLastErrorNumber());
} | java | private SSLException shutdownWithError(String operations, int sslError) {
return shutdownWithError(operations, sslError, SSL.getLastErrorNumber());
} | [
"private",
"SSLException",
"shutdownWithError",
"(",
"String",
"operations",
",",
"int",
"sslError",
")",
"{",
"return",
"shutdownWithError",
"(",
"operations",
",",
"sslError",
",",
"SSL",
".",
"getLastErrorNumber",
"(",
")",
")",
";",
"}"
] | Log the error, shutdown the engine and throw an exception. | [
"Log",
"the",
"error",
"shutdown",
"the",
"engine",
"and",
"throw",
"an",
"exception",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L955-L957 |
122,626 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java | ReferenceCountedOpenSslEngine.toJavaCipherSuite | private String toJavaCipherSuite(String openSslCipherSuite) {
if (openSslCipherSuite == null) {
return null;
}
String version = SSL.getVersion(ssl);
String prefix = toJavaCipherSuitePrefix(version);
return CipherSuiteConverter.toJava(openSslCipherSuite, prefix);
... | java | private String toJavaCipherSuite(String openSslCipherSuite) {
if (openSslCipherSuite == null) {
return null;
}
String version = SSL.getVersion(ssl);
String prefix = toJavaCipherSuitePrefix(version);
return CipherSuiteConverter.toJava(openSslCipherSuite, prefix);
... | [
"private",
"String",
"toJavaCipherSuite",
"(",
"String",
"openSslCipherSuite",
")",
"{",
"if",
"(",
"openSslCipherSuite",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"version",
"=",
"SSL",
".",
"getVersion",
"(",
"ssl",
")",
";",
"String",
... | Converts the specified OpenSSL cipher suite to the Java cipher suite. | [
"Converts",
"the",
"specified",
"OpenSSL",
"cipher",
"suite",
"to",
"the",
"Java",
"cipher",
"suite",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java#L1810-L1818 |
122,627 | netty/netty | codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java | MqttEncoder.doEncode | static ByteBuf doEncode(ByteBufAllocator byteBufAllocator, MqttMessage message) {
switch (message.fixedHeader().messageType()) {
case CONNECT:
return encodeConnectMessage(byteBufAllocator, (MqttConnectMessage) message);
case CONNACK:
return encodeConnAck... | java | static ByteBuf doEncode(ByteBufAllocator byteBufAllocator, MqttMessage message) {
switch (message.fixedHeader().messageType()) {
case CONNECT:
return encodeConnectMessage(byteBufAllocator, (MqttConnectMessage) message);
case CONNACK:
return encodeConnAck... | [
"static",
"ByteBuf",
"doEncode",
"(",
"ByteBufAllocator",
"byteBufAllocator",
",",
"MqttMessage",
"message",
")",
"{",
"switch",
"(",
"message",
".",
"fixedHeader",
"(",
")",
".",
"messageType",
"(",
")",
")",
"{",
"case",
"CONNECT",
":",
"return",
"encodeConn... | This is the main encoding method.
It's only visible for testing.
@param byteBufAllocator Allocates ByteBuf
@param message MQTT message to encode
@return ByteBuf with encoded bytes | [
"This",
"is",
"the",
"main",
"encoding",
"method",
".",
"It",
"s",
"only",
"visible",
"for",
"testing",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java#L56-L93 |
122,628 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java | Http2ServerUpgradeCodec.decodeSettings | private Http2Settings decodeSettings(ChannelHandlerContext ctx, ByteBuf frame) throws Http2Exception {
try {
final Http2Settings decodedSettings = new Http2Settings();
frameReader.readFrame(ctx, frame, new Http2FrameAdapter() {
@Override
public void onSett... | java | private Http2Settings decodeSettings(ChannelHandlerContext ctx, ByteBuf frame) throws Http2Exception {
try {
final Http2Settings decodedSettings = new Http2Settings();
frameReader.readFrame(ctx, frame, new Http2FrameAdapter() {
@Override
public void onSett... | [
"private",
"Http2Settings",
"decodeSettings",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ByteBuf",
"frame",
")",
"throws",
"Http2Exception",
"{",
"try",
"{",
"final",
"Http2Settings",
"decodedSettings",
"=",
"new",
"Http2Settings",
"(",
")",
";",
"frameReader",
".",... | Decodes the settings frame and returns the settings. | [
"Decodes",
"the",
"settings",
"frame",
"and",
"returns",
"the",
"settings",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java#L190-L203 |
122,629 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java | Http2ServerUpgradeCodec.createSettingsFrame | private static ByteBuf createSettingsFrame(ChannelHandlerContext ctx, ByteBuf payload) {
ByteBuf frame = ctx.alloc().buffer(FRAME_HEADER_LENGTH + payload.readableBytes());
writeFrameHeader(frame, payload.readableBytes(), SETTINGS, new Http2Flags(), 0);
frame.writeBytes(payload);
payload.... | java | private static ByteBuf createSettingsFrame(ChannelHandlerContext ctx, ByteBuf payload) {
ByteBuf frame = ctx.alloc().buffer(FRAME_HEADER_LENGTH + payload.readableBytes());
writeFrameHeader(frame, payload.readableBytes(), SETTINGS, new Http2Flags(), 0);
frame.writeBytes(payload);
payload.... | [
"private",
"static",
"ByteBuf",
"createSettingsFrame",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ByteBuf",
"payload",
")",
"{",
"ByteBuf",
"frame",
"=",
"ctx",
".",
"alloc",
"(",
")",
".",
"buffer",
"(",
"FRAME_HEADER_LENGTH",
"+",
"payload",
".",
"readableByte... | Creates an HTTP2-Settings header with the given payload. The payload buffer is released. | [
"Creates",
"an",
"HTTP2",
"-",
"Settings",
"header",
"with",
"the",
"given",
"payload",
".",
"The",
"payload",
"buffer",
"is",
"released",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java#L208-L214 |
122,630 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.closeStreamLocal | @Override
public void closeStreamLocal(Http2Stream stream, ChannelFuture future) {
switch (stream.state()) {
case HALF_CLOSED_LOCAL:
case OPEN:
stream.closeLocalSide();
break;
default:
closeStream(stream, future);
... | java | @Override
public void closeStreamLocal(Http2Stream stream, ChannelFuture future) {
switch (stream.state()) {
case HALF_CLOSED_LOCAL:
case OPEN:
stream.closeLocalSide();
break;
default:
closeStream(stream, future);
... | [
"@",
"Override",
"public",
"void",
"closeStreamLocal",
"(",
"Http2Stream",
"stream",
",",
"ChannelFuture",
"future",
")",
"{",
"switch",
"(",
"stream",
".",
"state",
"(",
")",
")",
"{",
"case",
"HALF_CLOSED_LOCAL",
":",
"case",
"OPEN",
":",
"stream",
".",
... | Closes the local side of the given stream. If this causes the stream to be closed, adds a
hook to close the channel after the given future completes.
@param stream the stream to be half closed.
@param future If closing, the future after which to close the channel. | [
"Closes",
"the",
"local",
"side",
"of",
"the",
"given",
"stream",
".",
"If",
"this",
"causes",
"the",
"stream",
"to",
"be",
"closed",
"adds",
"a",
"hook",
"to",
"close",
"the",
"channel",
"after",
"the",
"given",
"future",
"completes",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L570-L581 |
122,631 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.closeStreamRemote | @Override
public void closeStreamRemote(Http2Stream stream, ChannelFuture future) {
switch (stream.state()) {
case HALF_CLOSED_REMOTE:
case OPEN:
stream.closeRemoteSide();
break;
default:
closeStream(stream, future);
... | java | @Override
public void closeStreamRemote(Http2Stream stream, ChannelFuture future) {
switch (stream.state()) {
case HALF_CLOSED_REMOTE:
case OPEN:
stream.closeRemoteSide();
break;
default:
closeStream(stream, future);
... | [
"@",
"Override",
"public",
"void",
"closeStreamRemote",
"(",
"Http2Stream",
"stream",
",",
"ChannelFuture",
"future",
")",
"{",
"switch",
"(",
"stream",
".",
"state",
"(",
")",
")",
"{",
"case",
"HALF_CLOSED_REMOTE",
":",
"case",
"OPEN",
":",
"stream",
".",
... | Closes the remote side of the given stream. If this causes the stream to be closed, adds a
hook to close the channel after the given future completes.
@param stream the stream to be half closed.
@param future If closing, the future after which to close the channel. | [
"Closes",
"the",
"remote",
"side",
"of",
"the",
"given",
"stream",
".",
"If",
"this",
"causes",
"the",
"stream",
"to",
"be",
"closed",
"adds",
"a",
"hook",
"to",
"close",
"the",
"channel",
"after",
"the",
"given",
"future",
"completes",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L590-L601 |
122,632 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.onConnectionError | protected void onConnectionError(ChannelHandlerContext ctx, boolean outbound,
Throwable cause, Http2Exception http2Ex) {
if (http2Ex == null) {
http2Ex = new Http2Exception(INTERNAL_ERROR, cause.getMessage(), cause);
}
ChannelPromise promise = ct... | java | protected void onConnectionError(ChannelHandlerContext ctx, boolean outbound,
Throwable cause, Http2Exception http2Ex) {
if (http2Ex == null) {
http2Ex = new Http2Exception(INTERNAL_ERROR, cause.getMessage(), cause);
}
ChannelPromise promise = ct... | [
"protected",
"void",
"onConnectionError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"boolean",
"outbound",
",",
"Throwable",
"cause",
",",
"Http2Exception",
"http2Ex",
")",
"{",
"if",
"(",
"http2Ex",
"==",
"null",
")",
"{",
"http2Ex",
"=",
"new",
"Http2Exception... | Handler for a connection error. Sends a GO_AWAY frame to the remote endpoint. Once all
streams are closed, the connection is shut down.
@param ctx the channel context
@param outbound {@code true} if the error was caused by an outbound operation.
@param cause the exception that was caught
@param http2Ex the {@link Http... | [
"Handler",
"for",
"a",
"connection",
"error",
".",
"Sends",
"a",
"GO_AWAY",
"frame",
"to",
"the",
"remote",
"endpoint",
".",
"Once",
"all",
"streams",
"are",
"closed",
"the",
"connection",
"is",
"shut",
"down",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L657-L670 |
122,633 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.handleServerHeaderDecodeSizeError | protected void handleServerHeaderDecodeSizeError(ChannelHandlerContext ctx, Http2Stream stream) {
encoder().writeHeaders(ctx, stream.id(), HEADERS_TOO_LARGE_HEADERS, 0, true, ctx.newPromise());
} | java | protected void handleServerHeaderDecodeSizeError(ChannelHandlerContext ctx, Http2Stream stream) {
encoder().writeHeaders(ctx, stream.id(), HEADERS_TOO_LARGE_HEADERS, 0, true, ctx.newPromise());
} | [
"protected",
"void",
"handleServerHeaderDecodeSizeError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Http2Stream",
"stream",
")",
"{",
"encoder",
"(",
")",
".",
"writeHeaders",
"(",
"ctx",
",",
"stream",
".",
"id",
"(",
")",
",",
"HEADERS_TOO_LARGE_HEADERS",
",",
... | Notifies client that this server has received headers that are larger than what it is
willing to accept. Override to change behavior.
@param ctx the channel context
@param stream the Http2Stream on which the header was received | [
"Notifies",
"client",
"that",
"this",
"server",
"has",
"received",
"headers",
"that",
"are",
"larger",
"than",
"what",
"it",
"is",
"willing",
"to",
"accept",
".",
"Override",
"to",
"change",
"behavior",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L732-L734 |
122,634 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.checkCloseConnection | private void checkCloseConnection(ChannelFuture future) {
// If this connection is closing and the graceful shutdown has completed, close the connection
// once this operation completes.
if (closeListener != null && isGracefulShutdownComplete()) {
ChannelFutureListener closeListener ... | java | private void checkCloseConnection(ChannelFuture future) {
// If this connection is closing and the graceful shutdown has completed, close the connection
// once this operation completes.
if (closeListener != null && isGracefulShutdownComplete()) {
ChannelFutureListener closeListener ... | [
"private",
"void",
"checkCloseConnection",
"(",
"ChannelFuture",
"future",
")",
"{",
"// If this connection is closing and the graceful shutdown has completed, close the connection",
"// once this operation completes.",
"if",
"(",
"closeListener",
"!=",
"null",
"&&",
"isGracefulShutd... | Closes the connection if the graceful shutdown process has completed.
@param future Represents the status that will be passed to the {@link #closeListener}. | [
"Closes",
"the",
"connection",
"if",
"the",
"graceful",
"shutdown",
"process",
"has",
"completed",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L853-L867 |
122,635 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodec.java | Http2ClientUpgradeCodec.getSettingsHeaderValue | private CharSequence getSettingsHeaderValue(ChannelHandlerContext ctx) {
ByteBuf buf = null;
ByteBuf encodedBuf = null;
try {
// Get the local settings for the handler.
Http2Settings settings = connectionHandler.decoder().localSettings();
// Serialize the pay... | java | private CharSequence getSettingsHeaderValue(ChannelHandlerContext ctx) {
ByteBuf buf = null;
ByteBuf encodedBuf = null;
try {
// Get the local settings for the handler.
Http2Settings settings = connectionHandler.decoder().localSettings();
// Serialize the pay... | [
"private",
"CharSequence",
"getSettingsHeaderValue",
"(",
"ChannelHandlerContext",
"ctx",
")",
"{",
"ByteBuf",
"buf",
"=",
"null",
";",
"ByteBuf",
"encodedBuf",
"=",
"null",
";",
"try",
"{",
"// Get the local settings for the handler.",
"Http2Settings",
"settings",
"=",... | Converts the current settings for the handler to the Base64-encoded representation used in
the HTTP2-Settings upgrade header. | [
"Converts",
"the",
"current",
"settings",
"for",
"the",
"handler",
"to",
"the",
"Base64",
"-",
"encoded",
"representation",
"used",
"in",
"the",
"HTTP2",
"-",
"Settings",
"upgrade",
"header",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodec.java#L114-L136 |
122,636 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getCharset | public static Charset getCharset(HttpMessage message, Charset defaultCharset) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharset(contentTypeValue, defaultCharset);
} else {
return defaul... | java | public static Charset getCharset(HttpMessage message, Charset defaultCharset) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharset(contentTypeValue, defaultCharset);
} else {
return defaul... | [
"public",
"static",
"Charset",
"getCharset",
"(",
"HttpMessage",
"message",
",",
"Charset",
"defaultCharset",
")",
"{",
"CharSequence",
"contentTypeValue",
"=",
"message",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HttpHeaderNames",
".",
"CONTENT_TYPE",
")",
";... | Fetch charset from message's Content-Type header.
@param message entity to fetch Content-Type header from
@param defaultCharset result to use in case of empty, incorrect or doesn't contain required part header value
@return the charset from message's Content-Type header or {@code defaultCharset}
if charset is n... | [
"Fetch",
"charset",
"from",
"message",
"s",
"Content",
"-",
"Type",
"header",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L371-L378 |
122,637 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getCharsetAsSequence | public static CharSequence getCharsetAsSequence(HttpMessage message) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharsetAsSequence(contentTypeValue);
} else {
return null;
}
} | java | public static CharSequence getCharsetAsSequence(HttpMessage message) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharsetAsSequence(contentTypeValue);
} else {
return null;
}
} | [
"public",
"static",
"CharSequence",
"getCharsetAsSequence",
"(",
"HttpMessage",
"message",
")",
"{",
"CharSequence",
"contentTypeValue",
"=",
"message",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HttpHeaderNames",
".",
"CONTENT_TYPE",
")",
";",
"if",
"(",
"cont... | Fetch charset from message's Content-Type header as a char sequence.
A lot of sites/possibly clients have charset="CHARSET", for example charset="utf-8". Or "utf8" instead of "utf-8"
This is not according to standard, but this method provide an ability to catch desired mistakes manually in code
@return the {@code Cha... | [
"Fetch",
"charset",
"from",
"message",
"s",
"Content",
"-",
"Type",
"header",
"as",
"a",
"char",
"sequence",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L430-L437 |
122,638 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getCharsetAsSequence | public static CharSequence getCharsetAsSequence(CharSequence contentTypeValue) {
if (contentTypeValue == null) {
throw new NullPointerException("contentTypeValue");
}
int indexOfCharset = AsciiString.indexOfIgnoreCaseAscii(contentTypeValue, CHARSET_EQUALS, 0);
if (indexOfCha... | java | public static CharSequence getCharsetAsSequence(CharSequence contentTypeValue) {
if (contentTypeValue == null) {
throw new NullPointerException("contentTypeValue");
}
int indexOfCharset = AsciiString.indexOfIgnoreCaseAscii(contentTypeValue, CHARSET_EQUALS, 0);
if (indexOfCha... | [
"public",
"static",
"CharSequence",
"getCharsetAsSequence",
"(",
"CharSequence",
"contentTypeValue",
")",
"{",
"if",
"(",
"contentTypeValue",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"contentTypeValue\"",
")",
";",
"}",
"int",
"indexOfC... | Fetch charset from Content-Type header value as a char sequence.
A lot of sites/possibly clients have charset="CHARSET", for example charset="utf-8". Or "utf8" instead of "utf-8"
This is not according to standard, but this method provide an ability to catch desired mistakes manually in code
@param contentTypeValue Co... | [
"Fetch",
"charset",
"from",
"Content",
"-",
"Type",
"header",
"value",
"as",
"a",
"char",
"sequence",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L450-L472 |
122,639 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getMimeType | public static CharSequence getMimeType(CharSequence contentTypeValue) {
if (contentTypeValue == null) {
throw new NullPointerException("contentTypeValue");
}
int indexOfSemicolon = AsciiString.indexOfIgnoreCaseAscii(contentTypeValue, SEMICOLON, 0);
if (indexOfSemicolon != As... | java | public static CharSequence getMimeType(CharSequence contentTypeValue) {
if (contentTypeValue == null) {
throw new NullPointerException("contentTypeValue");
}
int indexOfSemicolon = AsciiString.indexOfIgnoreCaseAscii(contentTypeValue, SEMICOLON, 0);
if (indexOfSemicolon != As... | [
"public",
"static",
"CharSequence",
"getMimeType",
"(",
"CharSequence",
"contentTypeValue",
")",
"{",
"if",
"(",
"contentTypeValue",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"contentTypeValue\"",
")",
";",
"}",
"int",
"indexOfSemicolon"... | Fetch MIME type part from Content-Type header value as a char sequence.
@param contentTypeValue Content-Type header value to parse
@return the MIME type as a {@code CharSequence} from message's Content-Type header
or {@code null} if content-type header or MIME type part of this header are not presented
<p/>
"content-t... | [
"Fetch",
"MIME",
"type",
"part",
"from",
"Content",
"-",
"Type",
"header",
"value",
"as",
"a",
"char",
"sequence",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L506-L517 |
122,640 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.formatHostnameForHttp | public static String formatHostnameForHttp(InetSocketAddress addr) {
String hostString = NetUtil.getHostname(addr);
if (NetUtil.isValidIpV6Address(hostString)) {
if (!addr.isUnresolved()) {
hostString = NetUtil.toAddressString(addr.getAddress());
}
ret... | java | public static String formatHostnameForHttp(InetSocketAddress addr) {
String hostString = NetUtil.getHostname(addr);
if (NetUtil.isValidIpV6Address(hostString)) {
if (!addr.isUnresolved()) {
hostString = NetUtil.toAddressString(addr.getAddress());
}
ret... | [
"public",
"static",
"String",
"formatHostnameForHttp",
"(",
"InetSocketAddress",
"addr",
")",
"{",
"String",
"hostString",
"=",
"NetUtil",
".",
"getHostname",
"(",
"addr",
")",
";",
"if",
"(",
"NetUtil",
".",
"isValidIpV6Address",
"(",
"hostString",
")",
")",
... | Formats the host string of an address so it can be used for computing an HTTP component
such as an URL or a Host header
@param addr the address
@return the formatted String | [
"Formats",
"the",
"host",
"string",
"of",
"an",
"address",
"so",
"it",
"can",
"be",
"used",
"for",
"computing",
"an",
"HTTP",
"component",
"such",
"as",
"an",
"URL",
"or",
"a",
"Host",
"header"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L526-L535 |
122,641 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.generateHuffmanCodeLengths | private static void generateHuffmanCodeLengths(final int alphabetSize,
final int[] symbolFrequencies, final int[] codeLengths) {
final int[] mergedFrequenciesAndIndices = new int[alphabetSize];
final int[] sortedFrequencies = new int[alphabetSize];
... | java | private static void generateHuffmanCodeLengths(final int alphabetSize,
final int[] symbolFrequencies, final int[] codeLengths) {
final int[] mergedFrequenciesAndIndices = new int[alphabetSize];
final int[] sortedFrequencies = new int[alphabetSize];
... | [
"private",
"static",
"void",
"generateHuffmanCodeLengths",
"(",
"final",
"int",
"alphabetSize",
",",
"final",
"int",
"[",
"]",
"symbolFrequencies",
",",
"final",
"int",
"[",
"]",
"codeLengths",
")",
"{",
"final",
"int",
"[",
"]",
"mergedFrequenciesAndIndices",
"... | Generate a Huffman code length table for a given list of symbol frequencies.
@param alphabetSize The total number of symbols
@param symbolFrequencies The frequencies of the symbols
@param codeLengths The array to which the generated code lengths should be written | [
"Generate",
"a",
"Huffman",
"code",
"length",
"table",
"for",
"a",
"given",
"list",
"of",
"symbol",
"frequencies",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L122-L153 |
122,642 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.assignHuffmanCodeSymbols | private void assignHuffmanCodeSymbols() {
final int[][] huffmanMergedCodeSymbols = this.huffmanMergedCodeSymbols;
final int[][] huffmanCodeLengths = this.huffmanCodeLengths;
final int mtfAlphabetSize = this.mtfAlphabetSize;
final int totalTables = huffmanCodeLengths.length;
for... | java | private void assignHuffmanCodeSymbols() {
final int[][] huffmanMergedCodeSymbols = this.huffmanMergedCodeSymbols;
final int[][] huffmanCodeLengths = this.huffmanCodeLengths;
final int mtfAlphabetSize = this.mtfAlphabetSize;
final int totalTables = huffmanCodeLengths.length;
for... | [
"private",
"void",
"assignHuffmanCodeSymbols",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"[",
"]",
"huffmanMergedCodeSymbols",
"=",
"this",
".",
"huffmanMergedCodeSymbols",
";",
"final",
"int",
"[",
"]",
"[",
"]",
"huffmanCodeLengths",
"=",
"this",
".",
"huffma... | Assigns Canonical Huffman codes based on the calculated lengths. | [
"Assigns",
"Canonical",
"Huffman",
"codes",
"based",
"on",
"the",
"calculated",
"lengths",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L263-L296 |
122,643 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.writeSelectorsAndHuffmanTables | private void writeSelectorsAndHuffmanTables(ByteBuf out) {
final Bzip2BitWriter writer = this.writer;
final byte[] selectors = this.selectors;
final int totalSelectors = selectors.length;
final int[][] huffmanCodeLengths = this.huffmanCodeLengths;
final int totalTables = huffmanC... | java | private void writeSelectorsAndHuffmanTables(ByteBuf out) {
final Bzip2BitWriter writer = this.writer;
final byte[] selectors = this.selectors;
final int totalSelectors = selectors.length;
final int[][] huffmanCodeLengths = this.huffmanCodeLengths;
final int totalTables = huffmanC... | [
"private",
"void",
"writeSelectorsAndHuffmanTables",
"(",
"ByteBuf",
"out",
")",
"{",
"final",
"Bzip2BitWriter",
"writer",
"=",
"this",
".",
"writer",
";",
"final",
"byte",
"[",
"]",
"selectors",
"=",
"this",
".",
"selectors",
";",
"final",
"int",
"totalSelect... | Write out the selector list and Huffman tables. | [
"Write",
"out",
"the",
"selector",
"list",
"and",
"Huffman",
"tables",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L301-L335 |
122,644 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.writeBlockData | private void writeBlockData(ByteBuf out) {
final Bzip2BitWriter writer = this.writer;
final int[][] huffmanMergedCodeSymbols = this.huffmanMergedCodeSymbols;
final byte[] selectors = this.selectors;
final char[] mtf = mtfBlock;
final int mtfLength = this.mtfLength;
int s... | java | private void writeBlockData(ByteBuf out) {
final Bzip2BitWriter writer = this.writer;
final int[][] huffmanMergedCodeSymbols = this.huffmanMergedCodeSymbols;
final byte[] selectors = this.selectors;
final char[] mtf = mtfBlock;
final int mtfLength = this.mtfLength;
int s... | [
"private",
"void",
"writeBlockData",
"(",
"ByteBuf",
"out",
")",
"{",
"final",
"Bzip2BitWriter",
"writer",
"=",
"this",
".",
"writer",
";",
"final",
"int",
"[",
"]",
"[",
"]",
"huffmanMergedCodeSymbols",
"=",
"this",
".",
"huffmanMergedCodeSymbols",
";",
"fina... | Writes out the encoded block data. | [
"Writes",
"out",
"the",
"encoded",
"block",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L340-L357 |
122,645 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.encode | void encode(ByteBuf out) {
// Create optimised selector list and Huffman tables
generateHuffmanOptimisationSeeds();
for (int i = 3; i >= 0; i--) {
optimiseSelectorsAndHuffmanTables(i == 0);
}
assignHuffmanCodeSymbols();
// Write out the tables and the block d... | java | void encode(ByteBuf out) {
// Create optimised selector list and Huffman tables
generateHuffmanOptimisationSeeds();
for (int i = 3; i >= 0; i--) {
optimiseSelectorsAndHuffmanTables(i == 0);
}
assignHuffmanCodeSymbols();
// Write out the tables and the block d... | [
"void",
"encode",
"(",
"ByteBuf",
"out",
")",
"{",
"// Create optimised selector list and Huffman tables",
"generateHuffmanOptimisationSeeds",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"3",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"optimiseSelectorsAndHu... | Encodes and writes the block data. | [
"Encodes",
"and",
"writes",
"the",
"block",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L362-L373 |
122,646 | netty/netty | handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java | ChunkedWriteHandler.resumeTransfer | public void resumeTransfer() {
final ChannelHandlerContext ctx = this.ctx;
if (ctx == null) {
return;
}
if (ctx.executor().inEventLoop()) {
resumeTransfer0(ctx);
} else {
// let the transfer resume on the next event loop round
ctx.e... | java | public void resumeTransfer() {
final ChannelHandlerContext ctx = this.ctx;
if (ctx == null) {
return;
}
if (ctx.executor().inEventLoop()) {
resumeTransfer0(ctx);
} else {
// let the transfer resume on the next event loop round
ctx.e... | [
"public",
"void",
"resumeTransfer",
"(",
")",
"{",
"final",
"ChannelHandlerContext",
"ctx",
"=",
"this",
".",
"ctx",
";",
"if",
"(",
"ctx",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"ctx",
".",
"executor",
"(",
")",
".",
"inEventLoop",
"... | Continues to fetch the chunks from the input. | [
"Continues",
"to",
"fetch",
"the",
"chunks",
"from",
"the",
"input",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java#L99-L116 |
122,647 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java | Bzip2BlockDecompressor.decodeHuffmanData | boolean decodeHuffmanData(final Bzip2HuffmanStageDecoder huffmanDecoder) {
final Bzip2BitReader reader = this.reader;
final byte[] bwtBlock = this.bwtBlock;
final byte[] huffmanSymbolMap = this.huffmanSymbolMap;
final int streamBlockSize = this.bwtBlock.length;
final int huffmanE... | java | boolean decodeHuffmanData(final Bzip2HuffmanStageDecoder huffmanDecoder) {
final Bzip2BitReader reader = this.reader;
final byte[] bwtBlock = this.bwtBlock;
final byte[] huffmanSymbolMap = this.huffmanSymbolMap;
final int streamBlockSize = this.bwtBlock.length;
final int huffmanE... | [
"boolean",
"decodeHuffmanData",
"(",
"final",
"Bzip2HuffmanStageDecoder",
"huffmanDecoder",
")",
"{",
"final",
"Bzip2BitReader",
"reader",
"=",
"this",
".",
"reader",
";",
"final",
"byte",
"[",
"]",
"bwtBlock",
"=",
"this",
".",
"bwtBlock",
";",
"final",
"byte",... | Reads the Huffman encoded data from the input stream, performs Run-Length Decoding and
applies the Move To Front transform to reconstruct the Burrows-Wheeler Transform array. | [
"Reads",
"the",
"Huffman",
"encoded",
"data",
"from",
"the",
"input",
"stream",
"performs",
"Run",
"-",
"Length",
"Decoding",
"and",
"applies",
"the",
"Move",
"To",
"Front",
"transform",
"to",
"reconstruct",
"the",
"Burrows",
"-",
"Wheeler",
"Transform",
"arra... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java#L171-L234 |
122,648 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java | Bzip2BlockDecompressor.initialiseInverseBWT | private void initialiseInverseBWT() {
final int bwtStartPointer = this.bwtStartPointer;
final byte[] bwtBlock = this.bwtBlock;
final int[] bwtMergedPointers = new int[bwtBlockLength];
final int[] characterBase = new int[256];
if (bwtStartPointer < 0 || bwtStartPointer >= bwtBlo... | java | private void initialiseInverseBWT() {
final int bwtStartPointer = this.bwtStartPointer;
final byte[] bwtBlock = this.bwtBlock;
final int[] bwtMergedPointers = new int[bwtBlockLength];
final int[] characterBase = new int[256];
if (bwtStartPointer < 0 || bwtStartPointer >= bwtBlo... | [
"private",
"void",
"initialiseInverseBWT",
"(",
")",
"{",
"final",
"int",
"bwtStartPointer",
"=",
"this",
".",
"bwtStartPointer",
";",
"final",
"byte",
"[",
"]",
"bwtBlock",
"=",
"this",
".",
"bwtBlock",
";",
"final",
"int",
"[",
"]",
"bwtMergedPointers",
"=... | Set up the Inverse Burrows-Wheeler Transform merged pointer array. | [
"Set",
"up",
"the",
"Inverse",
"Burrows",
"-",
"Wheeler",
"Transform",
"merged",
"pointer",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java#L239-L266 |
122,649 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java | Bzip2BlockDecompressor.read | public int read() {
while (rleRepeat < 1) {
if (bwtBytesDecoded == bwtBlockLength) {
return -1;
}
int nextByte = decodeNextBWTByte();
if (nextByte != rleLastDecodedByte) {
// New byte, restart accumulation
rleLastDe... | java | public int read() {
while (rleRepeat < 1) {
if (bwtBytesDecoded == bwtBlockLength) {
return -1;
}
int nextByte = decodeNextBWTByte();
if (nextByte != rleLastDecodedByte) {
// New byte, restart accumulation
rleLastDe... | [
"public",
"int",
"read",
"(",
")",
"{",
"while",
"(",
"rleRepeat",
"<",
"1",
")",
"{",
"if",
"(",
"bwtBytesDecoded",
"==",
"bwtBlockLength",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"nextByte",
"=",
"decodeNextBWTByte",
"(",
")",
";",
"if",
"("... | Decodes a byte from the final Run-Length Encoding stage, pulling a new byte from the
Burrows-Wheeler Transform stage when required.
@return The decoded byte, or -1 if there are no more bytes | [
"Decodes",
"a",
"byte",
"from",
"the",
"final",
"Run",
"-",
"Length",
"Encoding",
"stage",
"pulling",
"a",
"new",
"byte",
"from",
"the",
"Burrows",
"-",
"Wheeler",
"Transform",
"stage",
"when",
"required",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java#L273-L302 |
122,650 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java | Bzip2BlockDecompressor.decodeNextBWTByte | private int decodeNextBWTByte() {
int mergedPointer = bwtCurrentMergedPointer;
int nextDecodedByte = mergedPointer & 0xff;
bwtCurrentMergedPointer = bwtMergedPointers[mergedPointer >>> 8];
if (blockRandomised) {
if (--randomCount == 0) {
nextDecodedByte ^= 1... | java | private int decodeNextBWTByte() {
int mergedPointer = bwtCurrentMergedPointer;
int nextDecodedByte = mergedPointer & 0xff;
bwtCurrentMergedPointer = bwtMergedPointers[mergedPointer >>> 8];
if (blockRandomised) {
if (--randomCount == 0) {
nextDecodedByte ^= 1... | [
"private",
"int",
"decodeNextBWTByte",
"(",
")",
"{",
"int",
"mergedPointer",
"=",
"bwtCurrentMergedPointer",
";",
"int",
"nextDecodedByte",
"=",
"mergedPointer",
"&",
"0xff",
";",
"bwtCurrentMergedPointer",
"=",
"bwtMergedPointers",
"[",
"mergedPointer",
">>>",
"8",
... | Decodes a byte from the Burrows-Wheeler Transform stage. If the block has randomisation
applied, reverses the randomisation.
@return The decoded byte | [
"Decodes",
"a",
"byte",
"from",
"the",
"Burrows",
"-",
"Wheeler",
"Transform",
"stage",
".",
"If",
"the",
"block",
"has",
"randomisation",
"applied",
"reverses",
"the",
"randomisation",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java#L309-L324 |
122,651 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanEncoder.java | HpackHuffmanEncoder.encode | public void encode(ByteBuf out, CharSequence data) {
ObjectUtil.checkNotNull(out, "out");
if (data instanceof AsciiString) {
AsciiString string = (AsciiString) data;
try {
encodeProcessor.out = out;
string.forEachByte(encodeProcessor);
... | java | public void encode(ByteBuf out, CharSequence data) {
ObjectUtil.checkNotNull(out, "out");
if (data instanceof AsciiString) {
AsciiString string = (AsciiString) data;
try {
encodeProcessor.out = out;
string.forEachByte(encodeProcessor);
... | [
"public",
"void",
"encode",
"(",
"ByteBuf",
"out",
",",
"CharSequence",
"data",
")",
"{",
"ObjectUtil",
".",
"checkNotNull",
"(",
"out",
",",
"\"out\"",
")",
";",
"if",
"(",
"data",
"instanceof",
"AsciiString",
")",
"{",
"AsciiString",
"string",
"=",
"(",
... | Compresses the input string literal using the Huffman coding.
@param out the output stream for the compressed data
@param data the string literal to be Huffman encoded | [
"Compresses",
"the",
"input",
"string",
"literal",
"using",
"the",
"Huffman",
"coding",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanEncoder.java#L68-L83 |
122,652 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanEncoder.java | HpackHuffmanEncoder.getEncodedLength | int getEncodedLength(CharSequence data) {
if (data instanceof AsciiString) {
AsciiString string = (AsciiString) data;
try {
encodedLengthProcessor.reset();
string.forEachByte(encodedLengthProcessor);
return encodedLengthProcessor.length();
... | java | int getEncodedLength(CharSequence data) {
if (data instanceof AsciiString) {
AsciiString string = (AsciiString) data;
try {
encodedLengthProcessor.reset();
string.forEachByte(encodedLengthProcessor);
return encodedLengthProcessor.length();
... | [
"int",
"getEncodedLength",
"(",
"CharSequence",
"data",
")",
"{",
"if",
"(",
"data",
"instanceof",
"AsciiString",
")",
"{",
"AsciiString",
"string",
"=",
"(",
"AsciiString",
")",
"data",
";",
"try",
"{",
"encodedLengthProcessor",
".",
"reset",
"(",
")",
";",... | Returns the number of bytes required to Huffman encode the input string literal.
@param data the string literal to be Huffman encoded
@return the number of bytes required to Huffman encode {@code data} | [
"Returns",
"the",
"number",
"of",
"bytes",
"required",
"to",
"Huffman",
"encode",
"the",
"input",
"string",
"literal",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanEncoder.java#L117-L131 |
122,653 | netty/netty | common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java | NativeLibraryLoader.patchShadedLibraryId | static boolean patchShadedLibraryId(InputStream in, OutputStream out, String originalName, String name)
throws IOException {
byte[] buffer = new byte[8192];
int length;
// We read the whole native lib into memory to make it easier to monkey-patch the id.
ByteArrayOutputStream... | java | static boolean patchShadedLibraryId(InputStream in, OutputStream out, String originalName, String name)
throws IOException {
byte[] buffer = new byte[8192];
int length;
// We read the whole native lib into memory to make it easier to monkey-patch the id.
ByteArrayOutputStream... | [
"static",
"boolean",
"patchShadedLibraryId",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"String",
"originalName",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"8192",
"]",
";",... | Package-private for testing. | [
"Package",
"-",
"private",
"for",
"testing",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java#L241-L274 |
122,654 | netty/netty | common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java | NativeLibraryLoader.patchShadedLibraryId | private static boolean patchShadedLibraryId(byte[] bytes, String originalName, String name) {
// Our native libs always have the name as part of their id so we can search for it and replace it
// to make the ID unique if shading is used.
byte[] nameBytes = originalName.getBytes(CharsetUtil.UTF_8... | java | private static boolean patchShadedLibraryId(byte[] bytes, String originalName, String name) {
// Our native libs always have the name as part of their id so we can search for it and replace it
// to make the ID unique if shading is used.
byte[] nameBytes = originalName.getBytes(CharsetUtil.UTF_8... | [
"private",
"static",
"boolean",
"patchShadedLibraryId",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"originalName",
",",
"String",
"name",
")",
"{",
"// Our native libs always have the name as part of their id so we can search for it and replace it",
"// to make the ID unique ... | Try to patch shaded library to ensure it uses a unique ID. | [
"Try",
"to",
"patch",
"shaded",
"library",
"to",
"ensure",
"it",
"uses",
"a",
"unique",
"ID",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java#L283-L325 |
122,655 | netty/netty | codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java | AbstractBinaryMemcacheDecoder.invalidMessage | private M invalidMessage(Exception cause) {
state = State.BAD_MESSAGE;
M message = buildInvalidMessage();
message.setDecoderResult(DecoderResult.failure(cause));
return message;
} | java | private M invalidMessage(Exception cause) {
state = State.BAD_MESSAGE;
M message = buildInvalidMessage();
message.setDecoderResult(DecoderResult.failure(cause));
return message;
} | [
"private",
"M",
"invalidMessage",
"(",
"Exception",
"cause",
")",
"{",
"state",
"=",
"State",
".",
"BAD_MESSAGE",
";",
"M",
"message",
"=",
"buildInvalidMessage",
"(",
")",
";",
"message",
".",
"setDecoderResult",
"(",
"DecoderResult",
".",
"failure",
"(",
"... | Helper method to create a message indicating a invalid decoding result.
@param cause the cause of the decoding failure.
@return a valid message indicating failure. | [
"Helper",
"method",
"to",
"create",
"a",
"message",
"indicating",
"a",
"invalid",
"decoding",
"result",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java#L175-L180 |
122,656 | netty/netty | codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java | AbstractBinaryMemcacheDecoder.invalidChunk | private MemcacheContent invalidChunk(Exception cause) {
state = State.BAD_MESSAGE;
MemcacheContent chunk = new DefaultLastMemcacheContent(Unpooled.EMPTY_BUFFER);
chunk.setDecoderResult(DecoderResult.failure(cause));
return chunk;
} | java | private MemcacheContent invalidChunk(Exception cause) {
state = State.BAD_MESSAGE;
MemcacheContent chunk = new DefaultLastMemcacheContent(Unpooled.EMPTY_BUFFER);
chunk.setDecoderResult(DecoderResult.failure(cause));
return chunk;
} | [
"private",
"MemcacheContent",
"invalidChunk",
"(",
"Exception",
"cause",
")",
"{",
"state",
"=",
"State",
".",
"BAD_MESSAGE",
";",
"MemcacheContent",
"chunk",
"=",
"new",
"DefaultLastMemcacheContent",
"(",
"Unpooled",
".",
"EMPTY_BUFFER",
")",
";",
"chunk",
".",
... | Helper method to create a content chunk indicating a invalid decoding result.
@param cause the cause of the decoding failure.
@return a valid content chunk indicating failure. | [
"Helper",
"method",
"to",
"create",
"a",
"content",
"chunk",
"indicating",
"a",
"invalid",
"decoding",
"result",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java#L188-L193 |
122,657 | netty/netty | common/src/main/java/io/netty/util/internal/ReferenceCountUpdater.java | ReferenceCountUpdater.retain0 | private T retain0(T instance, final int increment, final int rawIncrement) {
int oldRef = updater().getAndAdd(instance, rawIncrement);
if (oldRef != 2 && oldRef != 4 && (oldRef & 1) != 0) {
throw new IllegalReferenceCountException(0, increment);
}
// don't pass 0!
if ... | java | private T retain0(T instance, final int increment, final int rawIncrement) {
int oldRef = updater().getAndAdd(instance, rawIncrement);
if (oldRef != 2 && oldRef != 4 && (oldRef & 1) != 0) {
throw new IllegalReferenceCountException(0, increment);
}
// don't pass 0!
if ... | [
"private",
"T",
"retain0",
"(",
"T",
"instance",
",",
"final",
"int",
"increment",
",",
"final",
"int",
"rawIncrement",
")",
"{",
"int",
"oldRef",
"=",
"updater",
"(",
")",
".",
"getAndAdd",
"(",
"instance",
",",
"rawIncrement",
")",
";",
"if",
"(",
"o... | rawIncrement == increment << 1 | [
"rawIncrement",
"==",
"increment",
"<<",
"1"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ReferenceCountUpdater.java#L120-L133 |
122,658 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2MultiplexCodec.java | Http2MultiplexCodec.channelReadComplete | @Override
public final void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
try {
onChannelReadComplete(ctx);
} finally {
parentReadInProgress = false;
tail = head = null;
// We always flush as this is what Http2ConnectionHandler does... | java | @Override
public final void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
try {
onChannelReadComplete(ctx);
} finally {
parentReadInProgress = false;
tail = head = null;
// We always flush as this is what Http2ConnectionHandler does... | [
"@",
"Override",
"public",
"final",
"void",
"channelReadComplete",
"(",
"ChannelHandlerContext",
"ctx",
")",
"throws",
"Exception",
"{",
"try",
"{",
"onChannelReadComplete",
"(",
"ctx",
")",
";",
"}",
"finally",
"{",
"parentReadInProgress",
"=",
"false",
";",
"t... | Notifies any child streams of the read completion. | [
"Notifies",
"any",
"child",
"streams",
"of",
"the",
"read",
"completion",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2MultiplexCodec.java#L385-L396 |
122,659 | netty/netty | common/src/main/java/io/netty/util/internal/MacAddressUtil.java | MacAddressUtil.bestAvailableMac | public static byte[] bestAvailableMac() {
// Find the best MAC address available.
byte[] bestMacAddr = EMPTY_BYTES;
InetAddress bestInetAddr = NetUtil.LOCALHOST4;
// Retrieve the list of available network interfaces.
Map<NetworkInterface, InetAddress> ifaces = new LinkedHashMap<... | java | public static byte[] bestAvailableMac() {
// Find the best MAC address available.
byte[] bestMacAddr = EMPTY_BYTES;
InetAddress bestInetAddr = NetUtil.LOCALHOST4;
// Retrieve the list of available network interfaces.
Map<NetworkInterface, InetAddress> ifaces = new LinkedHashMap<... | [
"public",
"static",
"byte",
"[",
"]",
"bestAvailableMac",
"(",
")",
"{",
"// Find the best MAC address available.",
"byte",
"[",
"]",
"bestMacAddr",
"=",
"EMPTY_BYTES",
";",
"InetAddress",
"bestInetAddr",
"=",
"NetUtil",
".",
"LOCALHOST4",
";",
"// Retrieve the list o... | Obtains the best MAC address found on local network interfaces.
Generally speaking, an active network interface used on public
networks is better than a local network interface.
@return byte array containing a MAC. null if no MAC can be found. | [
"Obtains",
"the",
"best",
"MAC",
"address",
"found",
"on",
"local",
"network",
"interfaces",
".",
"Generally",
"speaking",
"an",
"active",
"network",
"interface",
"used",
"on",
"public",
"networks",
"is",
"better",
"than",
"a",
"local",
"network",
"interface",
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/MacAddressUtil.java#L47-L131 |
122,660 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java | AbstractHttp2ConnectionHandlerBuilder.maxReservedStreams | protected B maxReservedStreams(int maxReservedStreams) {
enforceConstraint("server", "connection", connection);
enforceConstraint("server", "codec", decoder);
enforceConstraint("server", "codec", encoder);
this.maxReservedStreams = checkPositiveOrZero(maxReservedStreams, "maxReservedStr... | java | protected B maxReservedStreams(int maxReservedStreams) {
enforceConstraint("server", "connection", connection);
enforceConstraint("server", "codec", decoder);
enforceConstraint("server", "codec", encoder);
this.maxReservedStreams = checkPositiveOrZero(maxReservedStreams, "maxReservedStr... | [
"protected",
"B",
"maxReservedStreams",
"(",
"int",
"maxReservedStreams",
")",
"{",
"enforceConstraint",
"(",
"\"server\"",
",",
"\"connection\"",
",",
"connection",
")",
";",
"enforceConstraint",
"(",
"\"server\"",
",",
"\"codec\"",
",",
"decoder",
")",
";",
"enf... | Set the maximum number of streams which can be in the reserved state at any given time. | [
"Set",
"the",
"maximum",
"number",
"of",
"streams",
"which",
"can",
"be",
"in",
"the",
"reserved",
"state",
"at",
"any",
"given",
"time",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java#L201-L208 |
122,661 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpServerUpgradeHandler.java | HttpServerUpgradeHandler.isUpgradeRequest | private static boolean isUpgradeRequest(HttpObject msg) {
return msg instanceof HttpRequest && ((HttpRequest) msg).headers().get(HttpHeaderNames.UPGRADE) != null;
} | java | private static boolean isUpgradeRequest(HttpObject msg) {
return msg instanceof HttpRequest && ((HttpRequest) msg).headers().get(HttpHeaderNames.UPGRADE) != null;
} | [
"private",
"static",
"boolean",
"isUpgradeRequest",
"(",
"HttpObject",
"msg",
")",
"{",
"return",
"msg",
"instanceof",
"HttpRequest",
"&&",
"(",
"(",
"HttpRequest",
")",
"msg",
")",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HttpHeaderNames",
".",
"UPGRADE"... | Determines whether or not the message is an HTTP upgrade request. | [
"Determines",
"whether",
"or",
"not",
"the",
"message",
"is",
"an",
"HTTP",
"upgrade",
"request",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerUpgradeHandler.java#L253-L255 |
122,662 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpServerUpgradeHandler.java | HttpServerUpgradeHandler.createUpgradeResponse | private static FullHttpResponse createUpgradeResponse(CharSequence upgradeProtocol) {
DefaultFullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, SWITCHING_PROTOCOLS,
Unpooled.EMPTY_BUFFER, false);
res.headers().add(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE);
r... | java | private static FullHttpResponse createUpgradeResponse(CharSequence upgradeProtocol) {
DefaultFullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, SWITCHING_PROTOCOLS,
Unpooled.EMPTY_BUFFER, false);
res.headers().add(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE);
r... | [
"private",
"static",
"FullHttpResponse",
"createUpgradeResponse",
"(",
"CharSequence",
"upgradeProtocol",
")",
"{",
"DefaultFullHttpResponse",
"res",
"=",
"new",
"DefaultFullHttpResponse",
"(",
"HTTP_1_1",
",",
"SWITCHING_PROTOCOLS",
",",
"Unpooled",
".",
"EMPTY_BUFFER",
... | Creates the 101 Switching Protocols response message. | [
"Creates",
"the",
"101",
"Switching",
"Protocols",
"response",
"message",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerUpgradeHandler.java#L355-L361 |
122,663 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpServerUpgradeHandler.java | HttpServerUpgradeHandler.splitHeader | private static List<CharSequence> splitHeader(CharSequence header) {
final StringBuilder builder = new StringBuilder(header.length());
final List<CharSequence> protocols = new ArrayList<CharSequence>(4);
for (int i = 0; i < header.length(); ++i) {
char c = header.charAt(i);
... | java | private static List<CharSequence> splitHeader(CharSequence header) {
final StringBuilder builder = new StringBuilder(header.length());
final List<CharSequence> protocols = new ArrayList<CharSequence>(4);
for (int i = 0; i < header.length(); ++i) {
char c = header.charAt(i);
... | [
"private",
"static",
"List",
"<",
"CharSequence",
">",
"splitHeader",
"(",
"CharSequence",
"header",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"header",
".",
"length",
"(",
")",
")",
";",
"final",
"List",
"<",
"CharSequ... | Splits a comma-separated header value. The returned set is case-insensitive and contains each
part with whitespace removed. | [
"Splits",
"a",
"comma",
"-",
"separated",
"header",
"value",
".",
"The",
"returned",
"set",
"is",
"case",
"-",
"insensitive",
"and",
"contains",
"each",
"part",
"with",
"whitespace",
"removed",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerUpgradeHandler.java#L367-L391 |
122,664 | netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java | EpollEventLoop.modify | void modify(AbstractEpollChannel ch) throws IOException {
assert inEventLoop();
Native.epollCtlMod(epollFd.intValue(), ch.socket.intValue(), ch.flags);
} | java | void modify(AbstractEpollChannel ch) throws IOException {
assert inEventLoop();
Native.epollCtlMod(epollFd.intValue(), ch.socket.intValue(), ch.flags);
} | [
"void",
"modify",
"(",
"AbstractEpollChannel",
"ch",
")",
"throws",
"IOException",
"{",
"assert",
"inEventLoop",
"(",
")",
";",
"Native",
".",
"epollCtlMod",
"(",
"epollFd",
".",
"intValue",
"(",
")",
",",
"ch",
".",
"socket",
".",
"intValue",
"(",
")",
... | The flags of the given epoll was modified so update the registration | [
"The",
"flags",
"of",
"the",
"given",
"epoll",
"was",
"modified",
"so",
"update",
"the",
"registration"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java#L184-L187 |
122,665 | netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java | EpollEventLoop.handleLoopException | void handleLoopException(Throwable t) {
logger.warn("Unexpected exception in the selector loop.", t);
// Prevent possible consecutive immediate failures that lead to
// excessive CPU consumption.
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
... | java | void handleLoopException(Throwable t) {
logger.warn("Unexpected exception in the selector loop.", t);
// Prevent possible consecutive immediate failures that lead to
// excessive CPU consumption.
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
... | [
"void",
"handleLoopException",
"(",
"Throwable",
"t",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Unexpected exception in the selector loop.\"",
",",
"t",
")",
";",
"// Prevent possible consecutive immediate failures that lead to",
"// excessive CPU consumption.",
"try",
"{",
"T... | Visible only for testing! | [
"Visible",
"only",
"for",
"testing!"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java#L365-L375 |
122,666 | netty/netty | codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordDecoder.java | DefaultDnsRecordDecoder.decodeName | public static String decodeName(ByteBuf in) {
int position = -1;
int checked = 0;
final int end = in.writerIndex();
final int readable = in.readableBytes();
// Looking at the spec we should always have at least enough readable bytes to read a byte here but it seems
// so... | java | public static String decodeName(ByteBuf in) {
int position = -1;
int checked = 0;
final int end = in.writerIndex();
final int readable = in.readableBytes();
// Looking at the spec we should always have at least enough readable bytes to read a byte here but it seems
// so... | [
"public",
"static",
"String",
"decodeName",
"(",
"ByteBuf",
"in",
")",
"{",
"int",
"position",
"=",
"-",
"1",
";",
"int",
"checked",
"=",
"0",
";",
"final",
"int",
"end",
"=",
"in",
".",
"writerIndex",
"(",
")",
";",
"final",
"int",
"readable",
"=",
... | Retrieves a domain name given a buffer containing a DNS packet. If the
name contains a pointer, the position of the buffer will be set to
directly after the pointer's index after the name has been read.
@param in the byte buffer containing the DNS packet
@return the domain name for an entry | [
"Retrieves",
"a",
"domain",
"name",
"given",
"a",
"buffer",
"containing",
"a",
"DNS",
"packet",
".",
"If",
"the",
"name",
"contains",
"a",
"pointer",
"the",
"position",
"of",
"the",
"buffer",
"will",
"be",
"set",
"to",
"directly",
"after",
"the",
"pointer"... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordDecoder.java#L125-L190 |
122,667 | netty/netty | handler/src/main/java/io/netty/handler/traffic/GlobalTrafficShapingHandler.java | GlobalTrafficShapingHandler.createGlobalTrafficCounter | void createGlobalTrafficCounter(ScheduledExecutorService executor) {
if (executor == null) {
throw new NullPointerException("executor");
}
TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval);
setTrafficCounter(tc);
tc.start();
} | java | void createGlobalTrafficCounter(ScheduledExecutorService executor) {
if (executor == null) {
throw new NullPointerException("executor");
}
TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval);
setTrafficCounter(tc);
tc.start();
} | [
"void",
"createGlobalTrafficCounter",
"(",
"ScheduledExecutorService",
"executor",
")",
"{",
"if",
"(",
"executor",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"executor\"",
")",
";",
"}",
"TrafficCounter",
"tc",
"=",
"new",
"TrafficCoun... | Create the global TrafficCounter. | [
"Create",
"the",
"global",
"TrafficCounter",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/GlobalTrafficShapingHandler.java#L105-L112 |
122,668 | netty/netty | example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java | MemcacheClientHandler.write | @Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
String command = (String) msg;
if (command.startsWith("get ")) {
String keyString = command.substring("get ".length());
ByteBuf key = Unpooled.wrappedBuffer(keyString.getBytes(Charset... | java | @Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
String command = (String) msg;
if (command.startsWith("get ")) {
String keyString = command.substring("get ".length());
ByteBuf key = Unpooled.wrappedBuffer(keyString.getBytes(Charset... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
",",
"ChannelPromise",
"promise",
")",
"{",
"String",
"command",
"=",
"(",
"String",
")",
"msg",
";",
"if",
"(",
"command",
".",
"startsWith",
"(",
"\"ge... | Transforms basic string requests to binary memcache requests | [
"Transforms",
"basic",
"string",
"requests",
"to",
"binary",
"memcache",
"requests"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java#L35-L66 |
122,669 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.get | public String get(CharSequence name, String defaultValue) {
String value = get(name);
if (value == null) {
return defaultValue;
}
return value;
} | java | public String get(CharSequence name, String defaultValue) {
String value = get(name);
if (value == null) {
return defaultValue;
}
return value;
} | [
"public",
"String",
"get",
"(",
"CharSequence",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"value",
";... | Returns the value of a header with the specified name. If there are
more than one values for the specified name, the first value is returned.
@param name The name of the header to search
@return The first header value or {@code defaultValue} if there is no such header | [
"Returns",
"the",
"value",
"of",
"a",
"header",
"with",
"the",
"specified",
"name",
".",
"If",
"there",
"are",
"more",
"than",
"one",
"values",
"for",
"the",
"specified",
"name",
"the",
"first",
"value",
"is",
"returned",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1202-L1208 |
122,670 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.add | public HttpHeaders add(CharSequence name, Object value) {
return add(name.toString(), value);
} | java | public HttpHeaders add(CharSequence name, Object value) {
return add(name.toString(), value);
} | [
"public",
"HttpHeaders",
"add",
"(",
"CharSequence",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"add",
"(",
"name",
".",
"toString",
"(",
")",
",",
"value",
")",
";",
"}"
] | Adds a new header with the specified name and value.
If the specified value is not a {@link String}, it is converted
into a {@link String} by {@link Object#toString()}, except in the cases
of {@link Date} and {@link Calendar}, which are formatted to the date
format defined in <a href="http://www.w3.org/Protocols/rfc26... | [
"Adds",
"a",
"new",
"header",
"with",
"the",
"specified",
"name",
"and",
"value",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1379-L1381 |
122,671 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.add | public HttpHeaders add(CharSequence name, Iterable<?> values) {
return add(name.toString(), values);
} | java | public HttpHeaders add(CharSequence name, Iterable<?> values) {
return add(name.toString(), values);
} | [
"public",
"HttpHeaders",
"add",
"(",
"CharSequence",
"name",
",",
"Iterable",
"<",
"?",
">",
"values",
")",
"{",
"return",
"add",
"(",
"name",
".",
"toString",
"(",
")",
",",
"values",
")",
";",
"}"
] | Adds a new header with the specified name and values.
This getMethod can be represented approximately as the following code:
<pre>
for (Object v: values) {
if (v == null) {
break;
}
headers.add(name, v);
}
</pre>
@param name The name of the headers being set
@param values The values of the headers being set
@return {... | [
"Adds",
"a",
"new",
"header",
"with",
"the",
"specified",
"name",
"and",
"values",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1405-L1407 |
122,672 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.set | public HttpHeaders set(CharSequence name, Object value) {
return set(name.toString(), value);
} | java | public HttpHeaders set(CharSequence name, Object value) {
return set(name.toString(), value);
} | [
"public",
"HttpHeaders",
"set",
"(",
"CharSequence",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"set",
"(",
"name",
".",
"toString",
"(",
")",
",",
"value",
")",
";",
"}"
] | Sets a header with the specified name and value.
If there is an existing header with the same name, it is removed.
If the specified value is not a {@link String}, it is converted into a
{@link String} by {@link Object#toString()}, except for {@link Date}
and {@link Calendar}, which are formatted to the date format def... | [
"Sets",
"a",
"header",
"with",
"the",
"specified",
"name",
"and",
"value",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1458-L1460 |
122,673 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.set | public HttpHeaders set(CharSequence name, Iterable<?> values) {
return set(name.toString(), values);
} | java | public HttpHeaders set(CharSequence name, Iterable<?> values) {
return set(name.toString(), values);
} | [
"public",
"HttpHeaders",
"set",
"(",
"CharSequence",
"name",
",",
"Iterable",
"<",
"?",
">",
"values",
")",
"{",
"return",
"set",
"(",
"name",
".",
"toString",
"(",
")",
",",
"values",
")",
";",
"}"
] | Sets a header with the specified name and values.
If there is an existing header with the same name, it is removed.
This getMethod can be represented approximately as the following code:
<pre>
headers.remove(name);
for (Object v: values) {
if (v == null) {
break;
}
headers.add(name, v);
}
</pre>
@param name The name ... | [
"Sets",
"a",
"header",
"with",
"the",
"specified",
"name",
"and",
"values",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1486-L1488 |
122,674 | netty/netty | codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java | DefaultHeaders.copy | public DefaultHeaders<K, V, T> copy() {
DefaultHeaders<K, V, T> copy = new DefaultHeaders<K, V, T>(
hashingStrategy, valueConverter, nameValidator, entries.length);
copy.addImpl(this);
return copy;
} | java | public DefaultHeaders<K, V, T> copy() {
DefaultHeaders<K, V, T> copy = new DefaultHeaders<K, V, T>(
hashingStrategy, valueConverter, nameValidator, entries.length);
copy.addImpl(this);
return copy;
} | [
"public",
"DefaultHeaders",
"<",
"K",
",",
"V",
",",
"T",
">",
"copy",
"(",
")",
"{",
"DefaultHeaders",
"<",
"K",
",",
"V",
",",
"T",
">",
"copy",
"=",
"new",
"DefaultHeaders",
"<",
"K",
",",
"V",
",",
"T",
">",
"(",
"hashingStrategy",
",",
"valu... | Returns a deep copy of this instance. | [
"Returns",
"a",
"deep",
"copy",
"of",
"this",
"instance",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java#L1037-L1042 |
122,675 | netty/netty | handler/src/main/java/io/netty/handler/timeout/ReadTimeoutHandler.java | ReadTimeoutHandler.readTimedOut | protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
ctx.close();
closed = true;
}
} | java | protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
ctx.close();
closed = true;
}
} | [
"protected",
"void",
"readTimedOut",
"(",
"ChannelHandlerContext",
"ctx",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"closed",
")",
"{",
"ctx",
".",
"fireExceptionCaught",
"(",
"ReadTimeoutException",
".",
"INSTANCE",
")",
";",
"ctx",
".",
"close",
"(",
... | Is called when a read timeout was detected. | [
"Is",
"called",
"when",
"a",
"read",
"timeout",
"was",
"detected",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/timeout/ReadTimeoutHandler.java#L96-L102 |
122,676 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java | QueryStringDecoder.rawQuery | public String rawQuery() {
int start = pathEndIdx() + 1;
return start < uri.length() ? uri.substring(start) : EMPTY_STRING;
} | java | public String rawQuery() {
int start = pathEndIdx() + 1;
return start < uri.length() ? uri.substring(start) : EMPTY_STRING;
} | [
"public",
"String",
"rawQuery",
"(",
")",
"{",
"int",
"start",
"=",
"pathEndIdx",
"(",
")",
"+",
"1",
";",
"return",
"start",
"<",
"uri",
".",
"length",
"(",
")",
"?",
"uri",
".",
"substring",
"(",
"start",
")",
":",
"EMPTY_STRING",
";",
"}"
] | Returns raw query string of the URI. | [
"Returns",
"raw",
"query",
"string",
"of",
"the",
"URI",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java#L195-L198 |
122,677 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java | SpdyCodecUtil.getUnsignedShort | static int getUnsignedShort(ByteBuf buf, int offset) {
return (buf.getByte(offset) & 0xFF) << 8 |
buf.getByte(offset + 1) & 0xFF;
} | java | static int getUnsignedShort(ByteBuf buf, int offset) {
return (buf.getByte(offset) & 0xFF) << 8 |
buf.getByte(offset + 1) & 0xFF;
} | [
"static",
"int",
"getUnsignedShort",
"(",
"ByteBuf",
"buf",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"buf",
".",
"getByte",
"(",
"offset",
")",
"&",
"0xFF",
")",
"<<",
"8",
"|",
"buf",
".",
"getByte",
"(",
"offset",
"+",
"1",
")",
"&",
"0xFF"... | Reads a big-endian unsigned short integer from the buffer. | [
"Reads",
"a",
"big",
"-",
"endian",
"unsigned",
"short",
"integer",
"from",
"the",
"buffer",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java#L243-L246 |
122,678 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java | SpdyCodecUtil.getUnsignedMedium | static int getUnsignedMedium(ByteBuf buf, int offset) {
return (buf.getByte(offset) & 0xFF) << 16 |
(buf.getByte(offset + 1) & 0xFF) << 8 |
buf.getByte(offset + 2) & 0xFF;
} | java | static int getUnsignedMedium(ByteBuf buf, int offset) {
return (buf.getByte(offset) & 0xFF) << 16 |
(buf.getByte(offset + 1) & 0xFF) << 8 |
buf.getByte(offset + 2) & 0xFF;
} | [
"static",
"int",
"getUnsignedMedium",
"(",
"ByteBuf",
"buf",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"buf",
".",
"getByte",
"(",
"offset",
")",
"&",
"0xFF",
")",
"<<",
"16",
"|",
"(",
"buf",
".",
"getByte",
"(",
"offset",
"+",
"1",
")",
"&",... | Reads a big-endian unsigned medium integer from the buffer. | [
"Reads",
"a",
"big",
"-",
"endian",
"unsigned",
"medium",
"integer",
"from",
"the",
"buffer",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java#L251-L255 |
122,679 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java | SpdyCodecUtil.getSignedInt | static int getSignedInt(ByteBuf buf, int offset) {
return (buf.getByte(offset) & 0xFF) << 24 |
(buf.getByte(offset + 1) & 0xFF) << 16 |
(buf.getByte(offset + 2) & 0xFF) << 8 |
buf.getByte(offset + 3) & 0xFF;
} | java | static int getSignedInt(ByteBuf buf, int offset) {
return (buf.getByte(offset) & 0xFF) << 24 |
(buf.getByte(offset + 1) & 0xFF) << 16 |
(buf.getByte(offset + 2) & 0xFF) << 8 |
buf.getByte(offset + 3) & 0xFF;
} | [
"static",
"int",
"getSignedInt",
"(",
"ByteBuf",
"buf",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"buf",
".",
"getByte",
"(",
"offset",
")",
"&",
"0xFF",
")",
"<<",
"24",
"|",
"(",
"buf",
".",
"getByte",
"(",
"offset",
"+",
"1",
")",
"&",
"0... | Reads a big-endian signed integer from the buffer. | [
"Reads",
"a",
"big",
"-",
"endian",
"signed",
"integer",
"from",
"the",
"buffer",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java#L270-L275 |
122,680 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java | SpdyCodecUtil.validateHeaderName | static void validateHeaderName(CharSequence name) {
if (name == null) {
throw new NullPointerException("name");
}
if (name.length() == 0) {
throw new IllegalArgumentException(
"name cannot be length zero");
}
// Since name may only cont... | java | static void validateHeaderName(CharSequence name) {
if (name == null) {
throw new NullPointerException("name");
}
if (name.length() == 0) {
throw new IllegalArgumentException(
"name cannot be length zero");
}
// Since name may only cont... | [
"static",
"void",
"validateHeaderName",
"(",
"CharSequence",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"name\"",
")",
";",
"}",
"if",
"(",
"name",
".",
"length",
"(",
")",
"==",
"0",
")"... | Validate a SPDY header name. | [
"Validate",
"a",
"SPDY",
"header",
"name",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java#L288-L316 |
122,681 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java | SpdyCodecUtil.validateHeaderValue | static void validateHeaderValue(CharSequence value) {
if (value == null) {
throw new NullPointerException("value");
}
for (int i = 0; i < value.length(); i ++) {
char c = value.charAt(i);
if (c == 0) {
throw new IllegalArgumentException(
... | java | static void validateHeaderValue(CharSequence value) {
if (value == null) {
throw new NullPointerException("value");
}
for (int i = 0; i < value.length(); i ++) {
char c = value.charAt(i);
if (c == 0) {
throw new IllegalArgumentException(
... | [
"static",
"void",
"validateHeaderValue",
"(",
"CharSequence",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"value\"",
")",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"valu... | Validate a SPDY header value. Does not validate max length. | [
"Validate",
"a",
"SPDY",
"header",
"value",
".",
"Does",
"not",
"validate",
"max",
"length",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyCodecUtil.java#L321-L332 |
122,682 | netty/netty | buffer/src/main/java/io/netty/buffer/PoolThreadCache.java | PoolThreadCache.free | void free(boolean finalizer) {
// As free() may be called either by the finalizer or by FastThreadLocal.onRemoval(...) we need to ensure
// we only call this one time.
if (freed.compareAndSet(false, true)) {
int numFreed = free(tinySubPageDirectCaches, finalizer) +
... | java | void free(boolean finalizer) {
// As free() may be called either by the finalizer or by FastThreadLocal.onRemoval(...) we need to ensure
// we only call this one time.
if (freed.compareAndSet(false, true)) {
int numFreed = free(tinySubPageDirectCaches, finalizer) +
... | [
"void",
"free",
"(",
"boolean",
"finalizer",
")",
"{",
"// As free() may be called either by the finalizer or by FastThreadLocal.onRemoval(...) we need to ensure",
"// we only call this one time.",
"if",
"(",
"freed",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
... | Should be called if the Thread that uses this cache is about to exist to release resources out of the cache | [
"Should",
"be",
"called",
"if",
"the",
"Thread",
"that",
"uses",
"this",
"cache",
"is",
"about",
"to",
"exist",
"to",
"release",
"resources",
"out",
"of",
"the",
"cache"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java#L237-L261 |
122,683 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java | CorsConfigBuilder.allowedRequestHeaders | public CorsConfigBuilder allowedRequestHeaders(final CharSequence... headers) {
for (CharSequence header: headers) {
requestHeaders.add(header.toString());
}
return this;
} | java | public CorsConfigBuilder allowedRequestHeaders(final CharSequence... headers) {
for (CharSequence header: headers) {
requestHeaders.add(header.toString());
}
return this;
} | [
"public",
"CorsConfigBuilder",
"allowedRequestHeaders",
"(",
"final",
"CharSequence",
"...",
"headers",
")",
"{",
"for",
"(",
"CharSequence",
"header",
":",
"headers",
")",
"{",
"requestHeaders",
".",
"add",
"(",
"header",
".",
"toString",
"(",
")",
")",
";",
... | Specifies the if headers that should be returned in the CORS 'Access-Control-Allow-Headers'
response header.
If a client specifies headers on the request, for example by calling:
<pre>
xhr.setRequestHeader('My-Custom-Header', "SomeValue");
</pre>
the server will receive the above header name in the 'Access-Control-Req... | [
"Specifies",
"the",
"if",
"headers",
"that",
"should",
"be",
"returned",
"in",
"the",
"CORS",
"Access",
"-",
"Control",
"-",
"Allow",
"-",
"Headers",
"response",
"header",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L266-L271 |
122,684 | netty/netty | common/src/main/java/io/netty/util/concurrent/AbstractScheduledEventExecutor.java | AbstractScheduledEventExecutor.cancelScheduledTasks | protected void cancelScheduledTasks() {
assert inEventLoop();
PriorityQueue<ScheduledFutureTask<?>> scheduledTaskQueue = this.scheduledTaskQueue;
if (isNullOrEmpty(scheduledTaskQueue)) {
return;
}
final ScheduledFutureTask<?>[] scheduledTasks =
schedu... | java | protected void cancelScheduledTasks() {
assert inEventLoop();
PriorityQueue<ScheduledFutureTask<?>> scheduledTaskQueue = this.scheduledTaskQueue;
if (isNullOrEmpty(scheduledTaskQueue)) {
return;
}
final ScheduledFutureTask<?>[] scheduledTasks =
schedu... | [
"protected",
"void",
"cancelScheduledTasks",
"(",
")",
"{",
"assert",
"inEventLoop",
"(",
")",
";",
"PriorityQueue",
"<",
"ScheduledFutureTask",
"<",
"?",
">",
">",
"scheduledTaskQueue",
"=",
"this",
".",
"scheduledTaskQueue",
";",
"if",
"(",
"isNullOrEmpty",
"(... | Cancel all scheduled tasks.
This method MUST be called only when {@link #inEventLoop()} is {@code true}. | [
"Cancel",
"all",
"scheduled",
"tasks",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/AbstractScheduledEventExecutor.java#L73-L88 |
122,685 | netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.validIpV4ToBytes | static byte[] validIpV4ToBytes(String ip) {
int i;
return new byte[] {
ipv4WordToByte(ip, 0, i = ip.indexOf('.', 1)),
ipv4WordToByte(ip, i + 1, i = ip.indexOf('.', i + 2)),
ipv4WordToByte(ip, i + 1, i = ip.indexOf('.', i + 2)),
ipv4WordToBy... | java | static byte[] validIpV4ToBytes(String ip) {
int i;
return new byte[] {
ipv4WordToByte(ip, 0, i = ip.indexOf('.', 1)),
ipv4WordToByte(ip, i + 1, i = ip.indexOf('.', i + 2)),
ipv4WordToByte(ip, i + 1, i = ip.indexOf('.', i + 2)),
ipv4WordToBy... | [
"static",
"byte",
"[",
"]",
"validIpV4ToBytes",
"(",
"String",
"ip",
")",
"{",
"int",
"i",
";",
"return",
"new",
"byte",
"[",
"]",
"{",
"ipv4WordToByte",
"(",
"ip",
",",
"0",
",",
"i",
"=",
"ip",
".",
"indexOf",
"(",
"'",
"'",
",",
"1",
")",
")... | visible for tests | [
"visible",
"for",
"tests"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L406-L414 |
122,686 | netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.intToIpAddress | public static String intToIpAddress(int i) {
StringBuilder buf = new StringBuilder(15);
buf.append(i >> 24 & 0xff);
buf.append('.');
buf.append(i >> 16 & 0xff);
buf.append('.');
buf.append(i >> 8 & 0xff);
buf.append('.');
buf.append(i & 0xff);
retu... | java | public static String intToIpAddress(int i) {
StringBuilder buf = new StringBuilder(15);
buf.append(i >> 24 & 0xff);
buf.append('.');
buf.append(i >> 16 & 0xff);
buf.append('.');
buf.append(i >> 8 & 0xff);
buf.append('.');
buf.append(i & 0xff);
retu... | [
"public",
"static",
"String",
"intToIpAddress",
"(",
"int",
"i",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"15",
")",
";",
"buf",
".",
"append",
"(",
"i",
">>",
"24",
"&",
"0xff",
")",
";",
"buf",
".",
"append",
"(",
"'",
... | Converts a 32-bit integer into an IPv4 address. | [
"Converts",
"a",
"32",
"-",
"bit",
"integer",
"into",
"an",
"IPv4",
"address",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L419-L429 |
122,687 | netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.bytesToIpAddress | public static String bytesToIpAddress(byte[] bytes, int offset, int length) {
switch (length) {
case 4: {
return new StringBuilder(15)
.append(bytes[offset] & 0xff)
.append('.')
.append(bytes[offset + 1] & 0xff)
... | java | public static String bytesToIpAddress(byte[] bytes, int offset, int length) {
switch (length) {
case 4: {
return new StringBuilder(15)
.append(bytes[offset] & 0xff)
.append('.')
.append(bytes[offset + 1] & 0xff)
... | [
"public",
"static",
"String",
"bytesToIpAddress",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"switch",
"(",
"length",
")",
"{",
"case",
"4",
":",
"{",
"return",
"new",
"StringBuilder",
"(",
"15",
")",
".",
"... | Converts 4-byte or 16-byte data into an IPv4 or IPv6 string respectively.
@throws IllegalArgumentException
if {@code length} is not {@code 4} nor {@code 16} | [
"Converts",
"4",
"-",
"byte",
"or",
"16",
"-",
"byte",
"data",
"into",
"an",
"IPv4",
"or",
"IPv6",
"string",
"respectively",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L447-L464 |
122,688 | netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java | ReferenceCountedOpenSslContext.destroy | private void destroy() {
Lock writerLock = ctxLock.writeLock();
writerLock.lock();
try {
if (ctx != 0) {
if (enableOcsp) {
SSLContext.disableOcsp(ctx);
}
SSLContext.free(ctx);
ctx = 0;
... | java | private void destroy() {
Lock writerLock = ctxLock.writeLock();
writerLock.lock();
try {
if (ctx != 0) {
if (enableOcsp) {
SSLContext.disableOcsp(ctx);
}
SSLContext.free(ctx);
ctx = 0;
... | [
"private",
"void",
"destroy",
"(",
")",
"{",
"Lock",
"writerLock",
"=",
"ctxLock",
".",
"writeLock",
"(",
")",
";",
"writerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"ctx",
"!=",
"0",
")",
"{",
"if",
"(",
"enableOcsp",
")",
"{",
"S... | producing a segfault. | [
"producing",
"a",
"segfault",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java#L547-L567 |
122,689 | netty/netty | handler/src/main/java/io/netty/handler/ssl/SslHandler.java | SslHandler.applicationProtocol | public String applicationProtocol() {
SSLEngine engine = engine();
if (!(engine instanceof ApplicationProtocolAccessor)) {
return null;
}
return ((ApplicationProtocolAccessor) engine).getNegotiatedApplicationProtocol();
} | java | public String applicationProtocol() {
SSLEngine engine = engine();
if (!(engine instanceof ApplicationProtocolAccessor)) {
return null;
}
return ((ApplicationProtocolAccessor) engine).getNegotiatedApplicationProtocol();
} | [
"public",
"String",
"applicationProtocol",
"(",
")",
"{",
"SSLEngine",
"engine",
"=",
"engine",
"(",
")",
";",
"if",
"(",
"!",
"(",
"engine",
"instanceof",
"ApplicationProtocolAccessor",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"(",
"Appli... | Returns the name of the current application-level protocol.
@return the protocol name or {@code null} if application-level protocol has not been negotiated | [
"Returns",
"the",
"name",
"of",
"the",
"current",
"application",
"-",
"level",
"protocol",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L615-L622 |
122,690 | netty/netty | handler/src/main/java/io/netty/handler/ssl/SslHandler.java | SslHandler.setHandshakeSuccess | private void setHandshakeSuccess() {
handshakePromise.trySuccess(ctx.channel());
if (logger.isDebugEnabled()) {
logger.debug("{} HANDSHAKEN: {}", ctx.channel(), engine.getSession().getCipherSuite());
}
ctx.fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS);
... | java | private void setHandshakeSuccess() {
handshakePromise.trySuccess(ctx.channel());
if (logger.isDebugEnabled()) {
logger.debug("{} HANDSHAKEN: {}", ctx.channel(), engine.getSession().getCipherSuite());
}
ctx.fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS);
... | [
"private",
"void",
"setHandshakeSuccess",
"(",
")",
"{",
"handshakePromise",
".",
"trySuccess",
"(",
"ctx",
".",
"channel",
"(",
")",
")",
";",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"{} HANDSHAKEN: {... | Notify all the handshake futures about the successfully handshake | [
"Notify",
"all",
"the",
"handshake",
"futures",
"about",
"the",
"successfully",
"handshake"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L1742-L1754 |
122,691 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java | HttpPostStandardRequestDecoder.offer | @Override
public HttpPostStandardRequestDecoder offer(HttpContent content) {
checkDestroyed();
// Maybe we should better not copy here for performance reasons but this will need
// more care by the caller to release the content in a correct manner later
// So maybe something to opti... | java | @Override
public HttpPostStandardRequestDecoder offer(HttpContent content) {
checkDestroyed();
// Maybe we should better not copy here for performance reasons but this will need
// more care by the caller to release the content in a correct manner later
// So maybe something to opti... | [
"@",
"Override",
"public",
"HttpPostStandardRequestDecoder",
"offer",
"(",
"HttpContent",
"content",
")",
"{",
"checkDestroyed",
"(",
")",
";",
"// Maybe we should better not copy here for performance reasons but this will need",
"// more care by the caller to release the content in a ... | Initialized the internals from a new chunk
@param content
the new received chunk
@throws ErrorDataDecoderException
if there is a problem with the charset decoding or other
errors | [
"Initialized",
"the",
"internals",
"from",
"a",
"new",
"chunk"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java#L273-L294 |
122,692 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java | HttpPostStandardRequestDecoder.hasNext | @Override
public boolean hasNext() {
checkDestroyed();
if (currentStatus == MultiPartStatus.EPILOGUE) {
// OK except if end of list
if (bodyListHttpDataRank >= bodyListHttpData.size()) {
throw new EndOfDataDecoderException();
}
}
r... | java | @Override
public boolean hasNext() {
checkDestroyed();
if (currentStatus == MultiPartStatus.EPILOGUE) {
// OK except if end of list
if (bodyListHttpDataRank >= bodyListHttpData.size()) {
throw new EndOfDataDecoderException();
}
}
r... | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"checkDestroyed",
"(",
")",
";",
"if",
"(",
"currentStatus",
"==",
"MultiPartStatus",
".",
"EPILOGUE",
")",
"{",
"// OK except if end of list",
"if",
"(",
"bodyListHttpDataRank",
">=",
"bodyListHttpDa... | True if at current getStatus, there is an available decoded
InterfaceHttpData from the Body.
This getMethod works for chunked and not chunked request.
@return True if at current getStatus, there is a decoded InterfaceHttpData
@throws EndOfDataDecoderException
No more data will be available | [
"True",
"if",
"at",
"current",
"getStatus",
"there",
"is",
"an",
"available",
"decoded",
"InterfaceHttpData",
"from",
"the",
"Body",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java#L306-L317 |
122,693 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java | HttpPostStandardRequestDecoder.addHttpData | protected void addHttpData(InterfaceHttpData data) {
if (data == null) {
return;
}
List<InterfaceHttpData> datas = bodyMapHttpData.get(data.getName());
if (datas == null) {
datas = new ArrayList<InterfaceHttpData>(1);
bodyMapHttpData.put(data.getName()... | java | protected void addHttpData(InterfaceHttpData data) {
if (data == null) {
return;
}
List<InterfaceHttpData> datas = bodyMapHttpData.get(data.getName());
if (datas == null) {
datas = new ArrayList<InterfaceHttpData>(1);
bodyMapHttpData.put(data.getName()... | [
"protected",
"void",
"addHttpData",
"(",
"InterfaceHttpData",
"data",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
";",
"}",
"List",
"<",
"InterfaceHttpData",
">",
"datas",
"=",
"bodyMapHttpData",
".",
"get",
"(",
"data",
".",
"getName",
... | Utility function to add a new decoded data | [
"Utility",
"function",
"to",
"add",
"a",
"new",
"decoded",
"data"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java#L366-L377 |
122,694 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java | HttpPostBodyUtil.findNonWhitespace | static int findNonWhitespace(String sb, int offset) {
int result;
for (result = offset; result < sb.length(); result ++) {
if (!Character.isWhitespace(sb.charAt(result))) {
break;
}
}
return result;
} | java | static int findNonWhitespace(String sb, int offset) {
int result;
for (result = offset; result < sb.length(); result ++) {
if (!Character.isWhitespace(sb.charAt(result))) {
break;
}
}
return result;
} | [
"static",
"int",
"findNonWhitespace",
"(",
"String",
"sb",
",",
"int",
"offset",
")",
"{",
"int",
"result",
";",
"for",
"(",
"result",
"=",
"offset",
";",
"result",
"<",
"sb",
".",
"length",
"(",
")",
";",
"result",
"++",
")",
"{",
"if",
"(",
"!",
... | Find the first non whitespace
@return the rank of the first non whitespace | [
"Find",
"the",
"first",
"non",
"whitespace"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java#L129-L137 |
122,695 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java | HttpPostBodyUtil.findEndOfString | static int findEndOfString(String sb) {
int result;
for (result = sb.length(); result > 0; result --) {
if (!Character.isWhitespace(sb.charAt(result - 1))) {
break;
}
}
return result;
} | java | static int findEndOfString(String sb) {
int result;
for (result = sb.length(); result > 0; result --) {
if (!Character.isWhitespace(sb.charAt(result - 1))) {
break;
}
}
return result;
} | [
"static",
"int",
"findEndOfString",
"(",
"String",
"sb",
")",
"{",
"int",
"result",
";",
"for",
"(",
"result",
"=",
"sb",
".",
"length",
"(",
")",
";",
"result",
">",
"0",
";",
"result",
"--",
")",
"{",
"if",
"(",
"!",
"Character",
".",
"isWhitespa... | Find the end of String
@return the rank of the end of string | [
"Find",
"the",
"end",
"of",
"String"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java#L143-L151 |
122,696 | netty/netty | common/src/main/java/io/netty/util/HashedWheelTimer.java | HashedWheelTimer.start | public void start() {
switch (WORKER_STATE_UPDATER.get(this)) {
case WORKER_STATE_INIT:
if (WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_INIT, WORKER_STATE_STARTED)) {
workerThread.start();
}
break;
case WORKER_... | java | public void start() {
switch (WORKER_STATE_UPDATER.get(this)) {
case WORKER_STATE_INIT:
if (WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_INIT, WORKER_STATE_STARTED)) {
workerThread.start();
}
break;
case WORKER_... | [
"public",
"void",
"start",
"(",
")",
"{",
"switch",
"(",
"WORKER_STATE_UPDATER",
".",
"get",
"(",
"this",
")",
")",
"{",
"case",
"WORKER_STATE_INIT",
":",
"if",
"(",
"WORKER_STATE_UPDATER",
".",
"compareAndSet",
"(",
"this",
",",
"WORKER_STATE_INIT",
",",
"W... | Starts the background thread explicitly. The background thread will
start automatically on demand even if you did not call this method.
@throws IllegalStateException if this timer has been
{@linkplain #stop() stopped} already | [
"Starts",
"the",
"background",
"thread",
"explicitly",
".",
"The",
"background",
"thread",
"will",
"start",
"automatically",
"on",
"demand",
"even",
"if",
"you",
"did",
"not",
"call",
"this",
"method",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/HashedWheelTimer.java#L340-L363 |
122,697 | netty/netty | codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java | Socks4ServerDecoder.readString | private static String readString(String fieldName, ByteBuf in) {
int length = in.bytesBefore(MAX_FIELD_LENGTH + 1, (byte) 0);
if (length < 0) {
throw new DecoderException("field '" + fieldName + "' longer than " + MAX_FIELD_LENGTH + " chars");
}
String value = in.readSlice(l... | java | private static String readString(String fieldName, ByteBuf in) {
int length = in.bytesBefore(MAX_FIELD_LENGTH + 1, (byte) 0);
if (length < 0) {
throw new DecoderException("field '" + fieldName + "' longer than " + MAX_FIELD_LENGTH + " chars");
}
String value = in.readSlice(l... | [
"private",
"static",
"String",
"readString",
"(",
"String",
"fieldName",
",",
"ByteBuf",
"in",
")",
"{",
"int",
"length",
"=",
"in",
".",
"bytesBefore",
"(",
"MAX_FIELD_LENGTH",
"+",
"1",
",",
"(",
"byte",
")",
"0",
")",
";",
"if",
"(",
"length",
"<",
... | Reads a variable-length NUL-terminated string as defined in SOCKS4. | [
"Reads",
"a",
"variable",
"-",
"length",
"NUL",
"-",
"terminated",
"string",
"as",
"defined",
"in",
"SOCKS4",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java#L122-L132 |
122,698 | netty/netty | buffer/src/main/java/io/netty/buffer/PoolSubpage.java | PoolSubpage.allocate | long allocate() {
if (elemSize == 0) {
return toHandle(0);
}
if (numAvail == 0 || !doNotDestroy) {
return -1;
}
final int bitmapIdx = getNextAvail();
int q = bitmapIdx >>> 6;
int r = bitmapIdx & 63;
assert (bitmap[q] >>> r & 1) ==... | java | long allocate() {
if (elemSize == 0) {
return toHandle(0);
}
if (numAvail == 0 || !doNotDestroy) {
return -1;
}
final int bitmapIdx = getNextAvail();
int q = bitmapIdx >>> 6;
int r = bitmapIdx & 63;
assert (bitmap[q] >>> r & 1) ==... | [
"long",
"allocate",
"(",
")",
"{",
"if",
"(",
"elemSize",
"==",
"0",
")",
"{",
"return",
"toHandle",
"(",
"0",
")",
";",
"}",
"if",
"(",
"numAvail",
"==",
"0",
"||",
"!",
"doNotDestroy",
")",
"{",
"return",
"-",
"1",
";",
"}",
"final",
"int",
"... | Returns the bitmap index of the subpage allocation. | [
"Returns",
"the",
"bitmap",
"index",
"of",
"the",
"subpage",
"allocation",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolSubpage.java#L80-L100 |
122,699 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Lz4FrameEncoder.java | Lz4FrameEncoder.compressionLevel | private static int compressionLevel(int blockSize) {
if (blockSize < MIN_BLOCK_SIZE || blockSize > MAX_BLOCK_SIZE) {
throw new IllegalArgumentException(String.format(
"blockSize: %d (expected: %d-%d)", blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE));
}
int compression... | java | private static int compressionLevel(int blockSize) {
if (blockSize < MIN_BLOCK_SIZE || blockSize > MAX_BLOCK_SIZE) {
throw new IllegalArgumentException(String.format(
"blockSize: %d (expected: %d-%d)", blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE));
}
int compression... | [
"private",
"static",
"int",
"compressionLevel",
"(",
"int",
"blockSize",
")",
"{",
"if",
"(",
"blockSize",
"<",
"MIN_BLOCK_SIZE",
"||",
"blockSize",
">",
"MAX_BLOCK_SIZE",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
... | Calculates compression level on the basis of block size. | [
"Calculates",
"compression",
"level",
"on",
"the",
"basis",
"of",
"block",
"size",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Lz4FrameEncoder.java#L186-L194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.