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,700 | netty/netty | handler/src/main/java/io/netty/handler/timeout/WriteTimeoutHandler.java | WriteTimeoutHandler.writeTimedOut | protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE);
ctx.close();
closed = true;
}
} | java | protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE);
ctx.close();
closed = true;
}
} | [
"protected",
"void",
"writeTimedOut",
"(",
"ChannelHandlerContext",
"ctx",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"closed",
")",
"{",
"ctx",
".",
"fireExceptionCaught",
"(",
"WriteTimeoutException",
".",
"INSTANCE",
")",
";",
"ctx",
".",
"close",
"("... | Is called when a write timeout was detected | [
"Is",
"called",
"when",
"a",
"write",
"timeout",
"was",
"detected"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/timeout/WriteTimeoutHandler.java#L175-L181 |
122,701 | netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java | AbstractKQueueChannel.doConnect | protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception {
if (localAddress instanceof InetSocketAddress) {
checkResolvable((InetSocketAddress) localAddress);
}
InetSocketAddress remoteSocketAddr = remoteAddress instanceof InetSocketAddre... | java | protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception {
if (localAddress instanceof InetSocketAddress) {
checkResolvable((InetSocketAddress) localAddress);
}
InetSocketAddress remoteSocketAddr = remoteAddress instanceof InetSocketAddre... | [
"protected",
"boolean",
"doConnect",
"(",
"SocketAddress",
"remoteAddress",
",",
"SocketAddress",
"localAddress",
")",
"throws",
"Exception",
"{",
"if",
"(",
"localAddress",
"instanceof",
"InetSocketAddress",
")",
"{",
"checkResolvable",
"(",
"(",
"InetSocketAddress",
... | Connect to the remote peer | [
"Connect",
"to",
"the",
"remote",
"peer"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java#L665-L697 |
122,702 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java | WebSocketUtil.base64 | static String base64(byte[] data) {
ByteBuf encodedData = Unpooled.wrappedBuffer(data);
ByteBuf encoded = Base64.encode(encodedData);
String encodedString = encoded.toString(CharsetUtil.UTF_8);
encoded.release();
return encodedString;
} | java | static String base64(byte[] data) {
ByteBuf encodedData = Unpooled.wrappedBuffer(data);
ByteBuf encoded = Base64.encode(encodedData);
String encodedString = encoded.toString(CharsetUtil.UTF_8);
encoded.release();
return encodedString;
} | [
"static",
"String",
"base64",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"ByteBuf",
"encodedData",
"=",
"Unpooled",
".",
"wrappedBuffer",
"(",
"data",
")",
";",
"ByteBuf",
"encoded",
"=",
"Base64",
".",
"encode",
"(",
"encodedData",
")",
";",
"String",
"en... | Performs base64 encoding on the specified data
@param data The data to encode
@return An encoded string containing the data | [
"Performs",
"base64",
"encoding",
"on",
"the",
"specified",
"data"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java#L93-L99 |
122,703 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java | WebSocketUtil.randomNumber | static int randomNumber(int minimum, int maximum) {
assert minimum < maximum;
double fraction = PlatformDependent.threadLocalRandom().nextDouble();
// the idea here is that nextDouble gives us a random value
//
// 0 <= fraction <= 1
//
// the distanc... | java | static int randomNumber(int minimum, int maximum) {
assert minimum < maximum;
double fraction = PlatformDependent.threadLocalRandom().nextDouble();
// the idea here is that nextDouble gives us a random value
//
// 0 <= fraction <= 1
//
// the distanc... | [
"static",
"int",
"randomNumber",
"(",
"int",
"minimum",
",",
"int",
"maximum",
")",
"{",
"assert",
"minimum",
"<",
"maximum",
";",
"double",
"fraction",
"=",
"PlatformDependent",
".",
"threadLocalRandom",
"(",
")",
".",
"nextDouble",
"(",
")",
";",
"// the i... | Generates a pseudo-random number
@param minimum The minimum allowable value
@param maximum The maximum allowable value
@return A pseudo-random number | [
"Generates",
"a",
"pseudo",
"-",
"random",
"number"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java#L120-L144 |
122,704 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java | InboundHttp2ToHttpAdapter.removeMessage | protected final void removeMessage(Http2Stream stream, boolean release) {
FullHttpMessage msg = stream.removeProperty(messageKey);
if (release && msg != null) {
msg.release();
}
} | java | protected final void removeMessage(Http2Stream stream, boolean release) {
FullHttpMessage msg = stream.removeProperty(messageKey);
if (release && msg != null) {
msg.release();
}
} | [
"protected",
"final",
"void",
"removeMessage",
"(",
"Http2Stream",
"stream",
",",
"boolean",
"release",
")",
"{",
"FullHttpMessage",
"msg",
"=",
"stream",
".",
"removeProperty",
"(",
"messageKey",
")",
";",
"if",
"(",
"release",
"&&",
"msg",
"!=",
"null",
")... | The stream is out of scope for the HTTP message flow and will no longer be tracked
@param stream The stream to remove associated state with
@param release {@code true} to call release on the value if it is present. {@code false} to not call release. | [
"The",
"stream",
"is",
"out",
"of",
"scope",
"for",
"the",
"HTTP",
"message",
"flow",
"and",
"will",
"no",
"longer",
"be",
"tracked"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java#L93-L98 |
122,705 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java | InboundHttp2ToHttpAdapter.fireChannelRead | protected void fireChannelRead(ChannelHandlerContext ctx, FullHttpMessage msg, boolean release,
Http2Stream stream) {
removeMessage(stream, release);
HttpUtil.setContentLength(msg, msg.content().readableBytes());
ctx.fireChannelRead(msg);
} | java | protected void fireChannelRead(ChannelHandlerContext ctx, FullHttpMessage msg, boolean release,
Http2Stream stream) {
removeMessage(stream, release);
HttpUtil.setContentLength(msg, msg.content().readableBytes());
ctx.fireChannelRead(msg);
} | [
"protected",
"void",
"fireChannelRead",
"(",
"ChannelHandlerContext",
"ctx",
",",
"FullHttpMessage",
"msg",
",",
"boolean",
"release",
",",
"Http2Stream",
"stream",
")",
"{",
"removeMessage",
"(",
"stream",
",",
"release",
")",
";",
"HttpUtil",
".",
"setContentLen... | Set final headers and fire a channel read event
@param ctx The context to fire the event on
@param msg The message to send
@param release {@code true} to call release on the value if it is present. {@code false} to not call release.
@param stream the stream of the message which is being fired | [
"Set",
"final",
"headers",
"and",
"fire",
"a",
"channel",
"read",
"event"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java#L134-L139 |
122,706 | netty/netty | transport/src/main/java/io/netty/channel/nio/AbstractNioByteChannel.java | AbstractNioByteChannel.doWrite0 | protected final int doWrite0(ChannelOutboundBuffer in) throws Exception {
Object msg = in.current();
if (msg == null) {
// Directly return here so incompleteWrite(...) is not called.
return 0;
}
return doWriteInternal(in, in.current());
} | java | protected final int doWrite0(ChannelOutboundBuffer in) throws Exception {
Object msg = in.current();
if (msg == null) {
// Directly return here so incompleteWrite(...) is not called.
return 0;
}
return doWriteInternal(in, in.current());
} | [
"protected",
"final",
"int",
"doWrite0",
"(",
"ChannelOutboundBuffer",
"in",
")",
"throws",
"Exception",
"{",
"Object",
"msg",
"=",
"in",
".",
"current",
"(",
")",
";",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"// Directly return here so incompleteWrite(...) is... | Write objects to the OS.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as follows:
<ul>
<li>0 - if no write was attempted. This is appropriate if an empty ... | [
"Write",
"objects",
"to",
"the",
"OS",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/nio/AbstractNioByteChannel.java#L203-L210 |
122,707 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java | DnsNameResolverBuilder.searchDomains | public DnsNameResolverBuilder searchDomains(Iterable<String> searchDomains) {
checkNotNull(searchDomains, "searchDomains");
final List<String> list = new ArrayList<String>(4);
for (String f : searchDomains) {
if (f == null) {
break;
}
// Avo... | java | public DnsNameResolverBuilder searchDomains(Iterable<String> searchDomains) {
checkNotNull(searchDomains, "searchDomains");
final List<String> list = new ArrayList<String>(4);
for (String f : searchDomains) {
if (f == null) {
break;
}
// Avo... | [
"public",
"DnsNameResolverBuilder",
"searchDomains",
"(",
"Iterable",
"<",
"String",
">",
"searchDomains",
")",
"{",
"checkNotNull",
"(",
"searchDomains",
",",
"\"searchDomains\"",
")",
";",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"... | Set the list of search domains of the resolver.
@param searchDomains the search domains
@return {@code this} | [
"Set",
"the",
"list",
"of",
"search",
"domains",
"of",
"the",
"resolver",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java#L345-L365 |
122,708 | netty/netty | common/src/main/java/io/netty/util/internal/logging/Slf4JLoggerFactory.java | Slf4JLoggerFactory.wrapLogger | static InternalLogger wrapLogger(Logger logger) {
return logger instanceof LocationAwareLogger ?
new LocationAwareSlf4JLogger((LocationAwareLogger) logger) : new Slf4JLogger(logger);
} | java | static InternalLogger wrapLogger(Logger logger) {
return logger instanceof LocationAwareLogger ?
new LocationAwareSlf4JLogger((LocationAwareLogger) logger) : new Slf4JLogger(logger);
} | [
"static",
"InternalLogger",
"wrapLogger",
"(",
"Logger",
"logger",
")",
"{",
"return",
"logger",
"instanceof",
"LocationAwareLogger",
"?",
"new",
"LocationAwareSlf4JLogger",
"(",
"(",
"LocationAwareLogger",
")",
"logger",
")",
":",
"new",
"Slf4JLogger",
"(",
"logger... | package-private for testing. | [
"package",
"-",
"private",
"for",
"testing",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/logging/Slf4JLoggerFactory.java#L53-L56 |
122,709 | netty/netty | transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java | SimpleChannelPool.acquireHealthyFromPoolOrNew | private Future<Channel> acquireHealthyFromPoolOrNew(final Promise<Channel> promise) {
try {
final Channel ch = pollChannel();
if (ch == null) {
// No Channel left in the pool bootstrap a new Channel
Bootstrap bs = bootstrap.clone();
bs.attr... | java | private Future<Channel> acquireHealthyFromPoolOrNew(final Promise<Channel> promise) {
try {
final Channel ch = pollChannel();
if (ch == null) {
// No Channel left in the pool bootstrap a new Channel
Bootstrap bs = bootstrap.clone();
bs.attr... | [
"private",
"Future",
"<",
"Channel",
">",
"acquireHealthyFromPoolOrNew",
"(",
"final",
"Promise",
"<",
"Channel",
">",
"promise",
")",
"{",
"try",
"{",
"final",
"Channel",
"ch",
"=",
"pollChannel",
"(",
")",
";",
"if",
"(",
"ch",
"==",
"null",
")",
"{",
... | Tries to retrieve healthy channel from the pool if any or creates a new channel otherwise.
@param promise the promise to provide acquire result.
@return future for acquiring a channel. | [
"Tries",
"to",
"retrieve",
"healthy",
"channel",
"from",
"the",
"pool",
"if",
"any",
"or",
"creates",
"a",
"new",
"channel",
"otherwise",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java#L172-L207 |
122,710 | netty/netty | transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java | SimpleChannelPool.releaseAndOfferIfHealthy | private void releaseAndOfferIfHealthy(Channel channel, Promise<Void> promise, Future<Boolean> future)
throws Exception {
if (future.getNow()) { //channel turns out to be healthy, offering and releasing it.
releaseAndOffer(channel, promise);
} else { //channel not healthy, just re... | java | private void releaseAndOfferIfHealthy(Channel channel, Promise<Void> promise, Future<Boolean> future)
throws Exception {
if (future.getNow()) { //channel turns out to be healthy, offering and releasing it.
releaseAndOffer(channel, promise);
} else { //channel not healthy, just re... | [
"private",
"void",
"releaseAndOfferIfHealthy",
"(",
"Channel",
"channel",
",",
"Promise",
"<",
"Void",
">",
"promise",
",",
"Future",
"<",
"Boolean",
">",
"future",
")",
"throws",
"Exception",
"{",
"if",
"(",
"future",
".",
"getNow",
"(",
")",
")",
"{",
... | Adds the channel back to the pool only if the channel is healthy.
@param channel the channel to put back to the pool
@param promise offer operation promise.
@param future the future that contains information fif channel is healthy or not.
@throws Exception in case when failed to notify handler about release operation. | [
"Adds",
"the",
"channel",
"back",
"to",
"the",
"pool",
"only",
"if",
"the",
"channel",
"is",
"healthy",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/pool/SimpleChannelPool.java#L340-L348 |
122,711 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.copy | public void copy(int srcIdx, byte[] dst, int dstIdx, int length) {
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length("
+ length + ") <= srcLen(" + length() + ')');
}
... | java | public void copy(int srcIdx, byte[] dst, int dstIdx, int length) {
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length("
+ length + ") <= srcLen(" + length() + ')');
}
... | [
"public",
"void",
"copy",
"(",
"int",
"srcIdx",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstIdx",
",",
"int",
"length",
")",
"{",
"if",
"(",
"isOutOfBounds",
"(",
"srcIdx",
",",
"length",
",",
"length",
"(",
")",
")",
")",
"{",
"throw",
"new",
... | Copies the content of this string to a byte array.
@param srcIdx the starting offset of characters to copy.
@param dst the destination byte array.
@param dstIdx the starting offset in the destination byte array.
@param length the number of characters to copy. | [
"Copies",
"the",
"content",
"of",
"this",
"string",
"to",
"a",
"byte",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L410-L417 |
122,712 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.compareTo | @Override
public int compareTo(CharSequence string) {
if (this == string) {
return 0;
}
int result;
int length1 = length();
int length2 = string.length();
int minLength = Math.min(length1, length2);
for (int i = 0, j = arrayOffset(); i < minLength... | java | @Override
public int compareTo(CharSequence string) {
if (this == string) {
return 0;
}
int result;
int length1 = length();
int length2 = string.length();
int minLength = Math.min(length1, length2);
for (int i = 0, j = arrayOffset(); i < minLength... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"CharSequence",
"string",
")",
"{",
"if",
"(",
"this",
"==",
"string",
")",
"{",
"return",
"0",
";",
"}",
"int",
"result",
";",
"int",
"length1",
"=",
"length",
"(",
")",
";",
"int",
"length2",
"=",... | Compares the specified string to this string using the ASCII values of the characters. Returns 0 if the strings
contain the same characters in the same order. Returns a negative integer if the first non-equal character in
this string has an ASCII value which is less than the ASCII value of the character at the same pos... | [
"Compares",
"the",
"specified",
"string",
"to",
"this",
"string",
"using",
"the",
"ASCII",
"values",
"of",
"the",
"characters",
".",
"Returns",
"0",
"if",
"the",
"strings",
"contain",
"the",
"same",
"characters",
"in",
"the",
"same",
"order",
".",
"Returns",... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L447-L465 |
122,713 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.concat | public AsciiString concat(CharSequence string) {
int thisLen = length();
int thatLen = string.length();
if (thatLen == 0) {
return this;
}
if (string.getClass() == AsciiString.class) {
AsciiString that = (AsciiString) string;
if (isEmpty()) {
... | java | public AsciiString concat(CharSequence string) {
int thisLen = length();
int thatLen = string.length();
if (thatLen == 0) {
return this;
}
if (string.getClass() == AsciiString.class) {
AsciiString that = (AsciiString) string;
if (isEmpty()) {
... | [
"public",
"AsciiString",
"concat",
"(",
"CharSequence",
"string",
")",
"{",
"int",
"thisLen",
"=",
"length",
"(",
")",
";",
"int",
"thatLen",
"=",
"string",
".",
"length",
"(",
")",
";",
"if",
"(",
"thatLen",
"==",
"0",
")",
"{",
"return",
"this",
";... | Concatenates this string and the specified string.
@param string the string to concatenate
@return a new string which is the concatenation of this string and the specified string. | [
"Concatenates",
"this",
"string",
"and",
"the",
"specified",
"string",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L473-L503 |
122,714 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.endsWith | public boolean endsWith(CharSequence suffix) {
int suffixLen = suffix.length();
return regionMatches(length() - suffixLen, suffix, 0, suffixLen);
} | java | public boolean endsWith(CharSequence suffix) {
int suffixLen = suffix.length();
return regionMatches(length() - suffixLen, suffix, 0, suffixLen);
} | [
"public",
"boolean",
"endsWith",
"(",
"CharSequence",
"suffix",
")",
"{",
"int",
"suffixLen",
"=",
"suffix",
".",
"length",
"(",
")",
";",
"return",
"regionMatches",
"(",
"length",
"(",
")",
"-",
"suffixLen",
",",
"suffix",
",",
"0",
",",
"suffixLen",
")... | Compares the specified string to this string to determine if the specified string is a suffix.
@param suffix the suffix to look for.
@return {@code true} if the specified string is a suffix of this string, {@code false} otherwise.
@throws NullPointerException if {@code suffix} is {@code null}. | [
"Compares",
"the",
"specified",
"string",
"to",
"this",
"string",
"to",
"determine",
"if",
"the",
"specified",
"string",
"is",
"a",
"suffix",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L512-L515 |
122,715 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.contentEqualsIgnoreCase | public boolean contentEqualsIgnoreCase(CharSequence string) {
if (string == null || string.length() != length()) {
return false;
}
if (string.getClass() == AsciiString.class) {
AsciiString rhs = (AsciiString) string;
for (int i = arrayOffset(), j = rhs.arrayO... | java | public boolean contentEqualsIgnoreCase(CharSequence string) {
if (string == null || string.length() != length()) {
return false;
}
if (string.getClass() == AsciiString.class) {
AsciiString rhs = (AsciiString) string;
for (int i = arrayOffset(), j = rhs.arrayO... | [
"public",
"boolean",
"contentEqualsIgnoreCase",
"(",
"CharSequence",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"string",
".",
"length",
"(",
")",
"!=",
"length",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"string",
"... | Compares the specified string to this string ignoring the case of the characters and returns true if they are
equal.
@param string the string to compare.
@return {@code true} if the specified string is equal to this string, {@code false} otherwise. | [
"Compares",
"the",
"specified",
"string",
"to",
"this",
"string",
"ignoring",
"the",
"case",
"of",
"the",
"characters",
"and",
"returns",
"true",
"if",
"they",
"are",
"equal",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L524-L545 |
122,716 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.toCharArray | public char[] toCharArray(int start, int end) {
int length = end - start;
if (length == 0) {
return EmptyArrays.EMPTY_CHARS;
}
if (isOutOfBounds(start, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= start(" + start + ") <= srcIdx + ... | java | public char[] toCharArray(int start, int end) {
int length = end - start;
if (length == 0) {
return EmptyArrays.EMPTY_CHARS;
}
if (isOutOfBounds(start, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= start(" + start + ") <= srcIdx + ... | [
"public",
"char",
"[",
"]",
"toCharArray",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"length",
"=",
"end",
"-",
"start",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EmptyArrays",
".",
"EMPTY_CHARS",
";",
"}",
"if",
"(",... | Copies the characters in this string to a character array.
@return a character array containing the characters of this string. | [
"Copies",
"the",
"characters",
"in",
"this",
"string",
"to",
"a",
"character",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L561-L577 |
122,717 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.copy | public void copy(int srcIdx, char[] dst, int dstIdx, int length) {
if (dst == null) {
throw new NullPointerException("dst");
}
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + lengt... | java | public void copy(int srcIdx, char[] dst, int dstIdx, int length) {
if (dst == null) {
throw new NullPointerException("dst");
}
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + lengt... | [
"public",
"void",
"copy",
"(",
"int",
"srcIdx",
",",
"char",
"[",
"]",
"dst",
",",
"int",
"dstIdx",
",",
"int",
"length",
")",
"{",
"if",
"(",
"dst",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"dst\"",
")",
";",
"}",
"if... | Copied the content of this string to a character array.
@param srcIdx the starting offset of characters to copy.
@param dst the destination character array.
@param dstIdx the starting offset in the destination byte array.
@param length the number of characters to copy. | [
"Copied",
"the",
"content",
"of",
"this",
"string",
"to",
"a",
"character",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L587-L601 |
122,718 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.subSequence | public AsciiString subSequence(int start, int end, boolean copy) {
if (isOutOfBounds(start, end - start, length())) {
throw new IndexOutOfBoundsException("expected: 0 <= start(" + start + ") <= end (" + end + ") <= length("
+ length() + ')');
}
if (start ... | java | public AsciiString subSequence(int start, int end, boolean copy) {
if (isOutOfBounds(start, end - start, length())) {
throw new IndexOutOfBoundsException("expected: 0 <= start(" + start + ") <= end (" + end + ") <= length("
+ length() + ')');
}
if (start ... | [
"public",
"AsciiString",
"subSequence",
"(",
"int",
"start",
",",
"int",
"end",
",",
"boolean",
"copy",
")",
"{",
"if",
"(",
"isOutOfBounds",
"(",
"start",
",",
"end",
"-",
"start",
",",
"length",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBou... | Either copy or share a subset of underlying sub-sequence of bytes.
@param start the offset of the first character (inclusive).
@param end The index to stop at (exclusive).
@param copy If {@code true} then a copy of the underlying storage will be made.
If {@code false} then the underlying storage will be shared.
@return... | [
"Either",
"copy",
"or",
"share",
"a",
"subset",
"of",
"underlying",
"sub",
"-",
"sequence",
"of",
"bytes",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L634-L649 |
122,719 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.indexOf | public int indexOf(CharSequence subString, int start) {
final int subCount = subString.length();
if (start < 0) {
start = 0;
}
if (subCount <= 0) {
return start < length ? start : length;
}
if (subCount > length - start) {
return INDEX_... | java | public int indexOf(CharSequence subString, int start) {
final int subCount = subString.length();
if (start < 0) {
start = 0;
}
if (subCount <= 0) {
return start < length ? start : length;
}
if (subCount > length - start) {
return INDEX_... | [
"public",
"int",
"indexOf",
"(",
"CharSequence",
"subString",
",",
"int",
"start",
")",
"{",
"final",
"int",
"subCount",
"=",
"subString",
".",
"length",
"(",
")",
";",
"if",
"(",
"start",
"<",
"0",
")",
"{",
"start",
"=",
"0",
";",
"}",
"if",
"(",... | Searches in this string for the index of the specified string. The search for the string starts at the specified
offset and moves towards the end of this string.
@param subString the string to find.
@param start the starting offset.
@return the index of the first character of the specified string in this string, -1 if... | [
"Searches",
"in",
"this",
"string",
"for",
"the",
"index",
"of",
"the",
"specified",
"string",
".",
"The",
"search",
"for",
"the",
"string",
"starts",
"at",
"the",
"specified",
"offset",
"and",
"moves",
"towards",
"the",
"end",
"of",
"this",
"string",
"."
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L674-L704 |
122,720 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.regionMatches | public boolean regionMatches(int thisStart, CharSequence string, int start, int length) {
if (string == null) {
throw new NullPointerException("string");
}
if (start < 0 || string.length() - start < length) {
return false;
}
final int thisLen = length();... | java | public boolean regionMatches(int thisStart, CharSequence string, int start, int length) {
if (string == null) {
throw new NullPointerException("string");
}
if (start < 0 || string.length() - start < length) {
return false;
}
final int thisLen = length();... | [
"public",
"boolean",
"regionMatches",
"(",
"int",
"thisStart",
",",
"CharSequence",
"string",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"string\"",
")",
... | Compares the specified string to this string and compares the specified range of characters to determine if they
are the same.
@param thisStart the starting offset in this string.
@param string the string to compare.
@param start the starting offset in the specified string.
@param length the number of characters to co... | [
"Compares",
"the",
"specified",
"string",
"to",
"this",
"string",
"and",
"compares",
"the",
"specified",
"range",
"of",
"characters",
"to",
"determine",
"if",
"they",
"are",
"the",
"same",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L801-L826 |
122,721 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.regionMatches | public boolean regionMatches(boolean ignoreCase, int thisStart, CharSequence string, int start, int length) {
if (!ignoreCase) {
return regionMatches(thisStart, string, start, length);
}
if (string == null) {
throw new NullPointerException("string");
}
f... | java | public boolean regionMatches(boolean ignoreCase, int thisStart, CharSequence string, int start, int length) {
if (!ignoreCase) {
return regionMatches(thisStart, string, start, length);
}
if (string == null) {
throw new NullPointerException("string");
}
f... | [
"public",
"boolean",
"regionMatches",
"(",
"boolean",
"ignoreCase",
",",
"int",
"thisStart",
",",
"CharSequence",
"string",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"if",
"(",
"!",
"ignoreCase",
")",
"{",
"return",
"regionMatches",
"(",
"thisStar... | Compares the specified string to this string and compares the specified range of characters to determine if they
are the same. When ignoreCase is true, the case of the characters is ignored during the comparison.
@param ignoreCase specifies if case should be ignored.
@param thisStart the starting offset in this string... | [
"Compares",
"the",
"specified",
"string",
"to",
"this",
"string",
"and",
"compares",
"the",
"specified",
"range",
"of",
"characters",
"to",
"determine",
"if",
"they",
"are",
"the",
"same",
".",
"When",
"ignoreCase",
"is",
"true",
"the",
"case",
"of",
"the",
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L840-L865 |
122,722 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.replace | public AsciiString replace(char oldChar, char newChar) {
if (oldChar > MAX_CHAR_VALUE) {
return this;
}
final byte oldCharAsByte = c2b0(oldChar);
final byte newCharAsByte = c2b(newChar);
final int len = offset + length;
for (int i = offset; i < len; ++i) {
... | java | public AsciiString replace(char oldChar, char newChar) {
if (oldChar > MAX_CHAR_VALUE) {
return this;
}
final byte oldCharAsByte = c2b0(oldChar);
final byte newCharAsByte = c2b(newChar);
final int len = offset + length;
for (int i = offset; i < len; ++i) {
... | [
"public",
"AsciiString",
"replace",
"(",
"char",
"oldChar",
",",
"char",
"newChar",
")",
"{",
"if",
"(",
"oldChar",
">",
"MAX_CHAR_VALUE",
")",
"{",
"return",
"this",
";",
"}",
"final",
"byte",
"oldCharAsByte",
"=",
"c2b0",
"(",
"oldChar",
")",
";",
"fin... | Copies this string replacing occurrences of the specified character with another character.
@param oldChar the character to replace.
@param newChar the replacement character.
@return a new string with occurrences of oldChar replaced by newChar. | [
"Copies",
"this",
"string",
"replacing",
"occurrences",
"of",
"the",
"specified",
"character",
"with",
"another",
"character",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L874-L896 |
122,723 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.toLowerCase | public AsciiString toLowerCase() {
boolean lowercased = true;
int i, j;
final int len = length() + arrayOffset();
for (i = arrayOffset(); i < len; ++i) {
byte b = value[i];
if (b >= 'A' && b <= 'Z') {
lowercased = false;
break;
... | java | public AsciiString toLowerCase() {
boolean lowercased = true;
int i, j;
final int len = length() + arrayOffset();
for (i = arrayOffset(); i < len; ++i) {
byte b = value[i];
if (b >= 'A' && b <= 'Z') {
lowercased = false;
break;
... | [
"public",
"AsciiString",
"toLowerCase",
"(",
")",
"{",
"boolean",
"lowercased",
"=",
"true",
";",
"int",
"i",
",",
"j",
";",
"final",
"int",
"len",
"=",
"length",
"(",
")",
"+",
"arrayOffset",
"(",
")",
";",
"for",
"(",
"i",
"=",
"arrayOffset",
"(",
... | Converts the characters in this string to lowercase, using the default Locale.
@return a new string containing the lowercase characters equivalent to the characters in this string. | [
"Converts",
"the",
"characters",
"in",
"this",
"string",
"to",
"lowercase",
"using",
"the",
"default",
"Locale",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L928-L951 |
122,724 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.toUpperCase | public AsciiString toUpperCase() {
boolean uppercased = true;
int i, j;
final int len = length() + arrayOffset();
for (i = arrayOffset(); i < len; ++i) {
byte b = value[i];
if (b >= 'a' && b <= 'z') {
uppercased = false;
break;
... | java | public AsciiString toUpperCase() {
boolean uppercased = true;
int i, j;
final int len = length() + arrayOffset();
for (i = arrayOffset(); i < len; ++i) {
byte b = value[i];
if (b >= 'a' && b <= 'z') {
uppercased = false;
break;
... | [
"public",
"AsciiString",
"toUpperCase",
"(",
")",
"{",
"boolean",
"uppercased",
"=",
"true",
";",
"int",
"i",
",",
"j",
";",
"final",
"int",
"len",
"=",
"length",
"(",
")",
"+",
"arrayOffset",
"(",
")",
";",
"for",
"(",
"i",
"=",
"arrayOffset",
"(",
... | Converts the characters in this string to uppercase, using the default Locale.
@return a new string containing the uppercase characters equivalent to the characters in this string. | [
"Converts",
"the",
"characters",
"in",
"this",
"string",
"to",
"uppercase",
"using",
"the",
"default",
"Locale",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L958-L981 |
122,725 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.trim | public static CharSequence trim(CharSequence c) {
if (c.getClass() == AsciiString.class) {
return ((AsciiString) c).trim();
}
if (c instanceof String) {
return ((String) c).trim();
}
int start = 0, last = c.length() - 1;
int end = last;
whi... | java | public static CharSequence trim(CharSequence c) {
if (c.getClass() == AsciiString.class) {
return ((AsciiString) c).trim();
}
if (c instanceof String) {
return ((String) c).trim();
}
int start = 0, last = c.length() - 1;
int end = last;
whi... | [
"public",
"static",
"CharSequence",
"trim",
"(",
"CharSequence",
"c",
")",
"{",
"if",
"(",
"c",
".",
"getClass",
"(",
")",
"==",
"AsciiString",
".",
"class",
")",
"{",
"return",
"(",
"(",
"AsciiString",
")",
"c",
")",
".",
"trim",
"(",
")",
";",
"}... | Copies this string removing white space characters from the beginning and end of the string, and tries not to
copy if possible.
@param c The {@link CharSequence} to trim.
@return a new string with characters {@code <= \\u0020} removed from the beginning and the end. | [
"Copies",
"this",
"string",
"removing",
"white",
"space",
"characters",
"from",
"the",
"beginning",
"and",
"end",
"of",
"the",
"string",
"and",
"tries",
"not",
"to",
"copy",
"if",
"possible",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L990-L1009 |
122,726 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.trim | public AsciiString trim() {
int start = arrayOffset(), last = arrayOffset() + length() - 1;
int end = last;
while (start <= end && value[start] <= ' ') {
start++;
}
while (end >= start && value[end] <= ' ') {
end--;
}
if (start == 0 && end ... | java | public AsciiString trim() {
int start = arrayOffset(), last = arrayOffset() + length() - 1;
int end = last;
while (start <= end && value[start] <= ' ') {
start++;
}
while (end >= start && value[end] <= ' ') {
end--;
}
if (start == 0 && end ... | [
"public",
"AsciiString",
"trim",
"(",
")",
"{",
"int",
"start",
"=",
"arrayOffset",
"(",
")",
",",
"last",
"=",
"arrayOffset",
"(",
")",
"+",
"length",
"(",
")",
"-",
"1",
";",
"int",
"end",
"=",
"last",
";",
"while",
"(",
"start",
"<=",
"end",
"... | Duplicates this string removing white space characters from the beginning and end of the
string, without copying.
@return a new string with characters {@code <= \\u0020} removed from the beginning and the end. | [
"Duplicates",
"this",
"string",
"removing",
"white",
"space",
"characters",
"from",
"the",
"beginning",
"and",
"end",
"of",
"the",
"string",
"without",
"copying",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L1017-L1030 |
122,727 | netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.regionMatches | public static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, final int csStart,
final CharSequence string, final int start, final int length) {
if (cs == null || string == null) {
return false;
}
if (cs instanceof Strin... | java | public static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, final int csStart,
final CharSequence string, final int start, final int length) {
if (cs == null || string == null) {
return false;
}
if (cs instanceof Strin... | [
"public",
"static",
"boolean",
"regionMatches",
"(",
"final",
"CharSequence",
"cs",
",",
"final",
"boolean",
"ignoreCase",
",",
"final",
"int",
"csStart",
",",
"final",
"CharSequence",
"string",
",",
"final",
"int",
"start",
",",
"final",
"int",
"length",
")",... | This methods make regionMatches operation correctly for any chars in strings
@param cs the {@code CharSequence} to be processed
@param ignoreCase specifies if case should be ignored.
@param csStart the starting offset in the {@code cs} CharSequence
@param string the {@code CharSequence} to compare.
@param start the sta... | [
"This",
"methods",
"make",
"regionMatches",
"operation",
"correctly",
"for",
"any",
"chars",
"in",
"strings"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L1632-L1649 |
122,728 | netty/netty | common/src/main/java/io/netty/util/ReferenceCountUtil.java | ReferenceCountUtil.releaseLater | @Deprecated
public static <T> T releaseLater(T msg, int decrement) {
if (msg instanceof ReferenceCounted) {
ThreadDeathWatcher.watch(Thread.currentThread(), new ReleasingTask((ReferenceCounted) msg, decrement));
}
return msg;
} | java | @Deprecated
public static <T> T releaseLater(T msg, int decrement) {
if (msg instanceof ReferenceCounted) {
ThreadDeathWatcher.watch(Thread.currentThread(), new ReleasingTask((ReferenceCounted) msg, decrement));
}
return msg;
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
">",
"T",
"releaseLater",
"(",
"T",
"msg",
",",
"int",
"decrement",
")",
"{",
"if",
"(",
"msg",
"instanceof",
"ReferenceCounted",
")",
"{",
"ThreadDeathWatcher",
".",
"watch",
"(",
"Thread",
".",
"currentThr... | Schedules the specified object to be released when the caller thread terminates. Note that this operation is
intended to simplify reference counting of ephemeral objects during unit tests. Do not use it beyond the
intended use case.
@deprecated this may introduce a lot of memory usage so it is generally preferable to ... | [
"Schedules",
"the",
"specified",
"object",
"to",
"be",
"released",
"when",
"the",
"caller",
"thread",
"terminates",
".",
"Note",
"that",
"this",
"operation",
"is",
"intended",
"to",
"simplify",
"reference",
"counting",
"of",
"ephemeral",
"objects",
"during",
"un... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ReferenceCountUtil.java#L155-L161 |
122,729 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2LocalFlowController.java | DefaultHttp2LocalFlowController.windowUpdateRatio | public void windowUpdateRatio(float ratio) {
assert ctx == null || ctx.executor().inEventLoop();
checkValidRatio(ratio);
windowUpdateRatio = ratio;
} | java | public void windowUpdateRatio(float ratio) {
assert ctx == null || ctx.executor().inEventLoop();
checkValidRatio(ratio);
windowUpdateRatio = ratio;
} | [
"public",
"void",
"windowUpdateRatio",
"(",
"float",
"ratio",
")",
"{",
"assert",
"ctx",
"==",
"null",
"||",
"ctx",
".",
"executor",
"(",
")",
".",
"inEventLoop",
"(",
")",
";",
"checkValidRatio",
"(",
"ratio",
")",
";",
"windowUpdateRatio",
"=",
"ratio",
... | The window update ratio is used to determine when a window update must be sent. If the ratio
of bytes processed since the last update has meet or exceeded this ratio then a window update will
be sent. This is the global window update ratio that will be used for new streams.
@param ratio the ratio to use when checking i... | [
"The",
"window",
"update",
"ratio",
"is",
"used",
"to",
"determine",
"when",
"a",
"window",
"update",
"must",
"be",
"sent",
".",
"If",
"the",
"ratio",
"of",
"bytes",
"processed",
"since",
"the",
"last",
"update",
"has",
"meet",
"or",
"exceeded",
"this",
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2LocalFlowController.java#L214-L218 |
122,730 | netty/netty | handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java | AbstractTrafficShapingHandler.releaseReadSuspended | void releaseReadSuspended(ChannelHandlerContext ctx) {
Channel channel = ctx.channel();
channel.attr(READ_SUSPENDED).set(false);
channel.config().setAutoRead(true);
} | java | void releaseReadSuspended(ChannelHandlerContext ctx) {
Channel channel = ctx.channel();
channel.attr(READ_SUSPENDED).set(false);
channel.config().setAutoRead(true);
} | [
"void",
"releaseReadSuspended",
"(",
"ChannelHandlerContext",
"ctx",
")",
"{",
"Channel",
"channel",
"=",
"ctx",
".",
"channel",
"(",
")",
";",
"channel",
".",
"attr",
"(",
"READ_SUSPENDED",
")",
".",
"set",
"(",
"false",
")",
";",
"channel",
".",
"config"... | Release the Read suspension | [
"Release",
"the",
"Read",
"suspension"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java#L469-L473 |
122,731 | netty/netty | handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java | AbstractTrafficShapingHandler.checkWriteSuspend | void checkWriteSuspend(ChannelHandlerContext ctx, long delay, long queueSize) {
if (queueSize > maxWriteSize || delay > maxWriteDelay) {
setUserDefinedWritability(ctx, false);
}
} | java | void checkWriteSuspend(ChannelHandlerContext ctx, long delay, long queueSize) {
if (queueSize > maxWriteSize || delay > maxWriteDelay) {
setUserDefinedWritability(ctx, false);
}
} | [
"void",
"checkWriteSuspend",
"(",
"ChannelHandlerContext",
"ctx",
",",
"long",
"delay",
",",
"long",
"queueSize",
")",
"{",
"if",
"(",
"queueSize",
">",
"maxWriteSize",
"||",
"delay",
">",
"maxWriteDelay",
")",
"{",
"setUserDefinedWritability",
"(",
"ctx",
",",
... | Check the writability according to delay and size for the channel.
Set if necessary setUserDefinedWritability status.
@param delay the computed delay
@param queueSize the current queueSize | [
"Check",
"the",
"writability",
"according",
"to",
"delay",
"and",
"size",
"for",
"the",
"channel",
".",
"Set",
"if",
"necessary",
"setUserDefinedWritability",
"status",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java#L597-L601 |
122,732 | netty/netty | codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java | HAProxyMessage.decodeHeader | static HAProxyMessage decodeHeader(String header) {
if (header == null) {
throw new HAProxyProtocolException("header");
}
String[] parts = header.split(" ");
int numParts = parts.length;
if (numParts < 2) {
throw new HAProxyProtocolException(
... | java | static HAProxyMessage decodeHeader(String header) {
if (header == null) {
throw new HAProxyProtocolException("header");
}
String[] parts = header.split(" ");
int numParts = parts.length;
if (numParts < 2) {
throw new HAProxyProtocolException(
... | [
"static",
"HAProxyMessage",
"decodeHeader",
"(",
"String",
"header",
")",
"{",
"if",
"(",
"header",
"==",
"null",
")",
"{",
"throw",
"new",
"HAProxyProtocolException",
"(",
"\"header\"",
")",
";",
"}",
"String",
"[",
"]",
"parts",
"=",
"header",
".",
"spli... | Decodes a version 1, human-readable proxy protocol header.
@param header a version 1 proxy protocol header
@return {@link HAProxyMessage} instance
@throws HAProxyProtocolException if any portion of the header is invalid | [
"Decodes",
"a",
"version",
"1",
"human",
"-",
"readable",
"proxy",
"protocol",
"header",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java#L309-L350 |
122,733 | netty/netty | codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java | HAProxyMessage.ipBytesToString | private static String ipBytesToString(ByteBuf header, int addressLen) {
StringBuilder sb = new StringBuilder();
if (addressLen == 4) {
sb.append(header.readByte() & 0xff);
sb.append('.');
sb.append(header.readByte() & 0xff);
sb.append('.');
sb.... | java | private static String ipBytesToString(ByteBuf header, int addressLen) {
StringBuilder sb = new StringBuilder();
if (addressLen == 4) {
sb.append(header.readByte() & 0xff);
sb.append('.');
sb.append(header.readByte() & 0xff);
sb.append('.');
sb.... | [
"private",
"static",
"String",
"ipBytesToString",
"(",
"ByteBuf",
"header",
",",
"int",
"addressLen",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"addressLen",
"==",
"4",
")",
"{",
"sb",
".",
"append",
"(",
"he... | Convert ip address bytes to string representation
@param header buffer containing ip address bytes
@param addressLen number of bytes to read (4 bytes for IPv4, 16 bytes for IPv6)
@return string representation of the ip address | [
"Convert",
"ip",
"address",
"bytes",
"to",
"string",
"representation"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java#L359-L387 |
122,734 | netty/netty | codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java | HAProxyMessage.portStringToInt | private static int portStringToInt(String value) {
int port;
try {
port = Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new HAProxyProtocolException("invalid port: " + value, e);
}
if (port <= 0 || port > 65535) {
throw ne... | java | private static int portStringToInt(String value) {
int port;
try {
port = Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new HAProxyProtocolException("invalid port: " + value, e);
}
if (port <= 0 || port > 65535) {
throw ne... | [
"private",
"static",
"int",
"portStringToInt",
"(",
"String",
"value",
")",
"{",
"int",
"port",
";",
"try",
"{",
"port",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"throw",
"new",
... | Convert port to integer
@param value the port
@return port as an integer
@throws HAProxyProtocolException if port is not a valid integer | [
"Convert",
"port",
"to",
"integer"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java#L396-L409 |
122,735 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toFullHttpResponse | public static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
HttpResponseStatus status = parseStatus(http2Headers.status());
... | java | public static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
HttpResponseStatus status = parseStatus(http2Headers.status());
... | [
"public",
"static",
"FullHttpResponse",
"toFullHttpResponse",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"ByteBufAllocator",
"alloc",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"HttpResponseStatus",
"status",
"=",
... | Create a new object to contain the response data
@param streamId The stream associated with the response
@param http2Headers The initial set of HTTP/2 headers to create the response with
@param alloc The {@link ByteBufAllocator} to use to generate the content of the message
@param validateHttpHeaders <ul>
<li>{@code t... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"response",
"data"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L213-L231 |
122,736 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toFullHttpRequest | public static FullHttpRequest toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is includ... | java | public static FullHttpRequest toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is includ... | [
"public",
"static",
"FullHttpRequest",
"toFullHttpRequest",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"ByteBufAllocator",
"alloc",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"// HTTP/2 does not define a way to carry th... | Create a new object to contain the request data
@param streamId The stream associated with the request
@param http2Headers The initial set of HTTP/2 headers to create the request with
@param alloc The {@link ByteBufAllocator} to use to generate the content of the message
@param validateHttpHeaders <ul>
<li>{@code true... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"request",
"data"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L246-L266 |
122,737 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toHttpRequest | public static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is included in the HTTP/1.1 request line.
final CharSequence method = checkNotNul... | java | public static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is included in the HTTP/1.1 request line.
final CharSequence method = checkNotNul... | [
"public",
"static",
"HttpRequest",
"toHttpRequest",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"// HTTP/2 does not define a way to carry the version identifier that is included in the HTT... | Create a new object to contain the request data.
@param streamId The stream associated with the request
@param http2Headers The initial set of HTTP/2 headers to create the request with
@param validateHttpHeaders <ul>
<li>{@code true} to validate HTTP headers in the http-codec</li>
<li>{@code false} not to validate HTT... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"request",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L280-L297 |
122,738 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toHttpResponse | public static HttpResponse toHttpResponse(final int streamId,
final Http2Headers http2Headers,
final boolean validateHttpHeaders) throws Http2Exception {
final HttpResponseStatus status = parseStatus(http2Headers.status(... | java | public static HttpResponse toHttpResponse(final int streamId,
final Http2Headers http2Headers,
final boolean validateHttpHeaders) throws Http2Exception {
final HttpResponseStatus status = parseStatus(http2Headers.status(... | [
"public",
"static",
"HttpResponse",
"toHttpResponse",
"(",
"final",
"int",
"streamId",
",",
"final",
"Http2Headers",
"http2Headers",
",",
"final",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"final",
"HttpResponseStatus",
"status",
"=",
"pa... | Create a new object to contain the response data.
@param streamId The stream associated with the response
@param http2Headers The initial set of HTTP/2 headers to create the response with
@param validateHttpHeaders <ul>
<li>{@code true} to validate HTTP headers in the http-codec</li>
<li>{@code false} not to validate ... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"response",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L312-L327 |
122,739 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.setHttp2Authority | static void setHttp2Authority(String authority, Http2Headers out) {
// The authority MUST NOT include the deprecated "userinfo" subcomponent
if (authority != null) {
if (authority.isEmpty()) {
out.authority(EMPTY_STRING);
} else {
int start = autho... | java | static void setHttp2Authority(String authority, Http2Headers out) {
// The authority MUST NOT include the deprecated "userinfo" subcomponent
if (authority != null) {
if (authority.isEmpty()) {
out.authority(EMPTY_STRING);
} else {
int start = autho... | [
"static",
"void",
"setHttp2Authority",
"(",
"String",
"authority",
",",
"Http2Headers",
"out",
")",
"{",
"// The authority MUST NOT include the deprecated \"userinfo\" subcomponent",
"if",
"(",
"authority",
"!=",
"null",
")",
"{",
"if",
"(",
"authority",
".",
"isEmpty",... | package-private for testing only | [
"package",
"-",
"private",
"for",
"testing",
"only"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L545-L559 |
122,740 | netty/netty | common/src/main/java/io/netty/util/internal/PlatformDependent0.java | PlatformDependent0.majorVersion | static int majorVersion(final String javaSpecVersion) {
final String[] components = javaSpecVersion.split("\\.");
final int[] version = new int[components.length];
for (int i = 0; i < components.length; i++) {
version[i] = Integer.parseInt(components[i]);
}
if (versi... | java | static int majorVersion(final String javaSpecVersion) {
final String[] components = javaSpecVersion.split("\\.");
final int[] version = new int[components.length];
for (int i = 0; i < components.length; i++) {
version[i] = Integer.parseInt(components[i]);
}
if (versi... | [
"static",
"int",
"majorVersion",
"(",
"final",
"String",
"javaSpecVersion",
")",
"{",
"final",
"String",
"[",
"]",
"components",
"=",
"javaSpecVersion",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"final",
"int",
"[",
"]",
"version",
"=",
"new",
"int",
"[",
... | Package-private for testing only | [
"Package",
"-",
"private",
"for",
"testing",
"only"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L862-L875 |
122,741 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.setExtendedParentPointers | private static void setExtendedParentPointers(final int[] array) {
final int length = array.length;
array[0] += array[1];
for (int headNode = 0, tailNode = 1, topNode = 2; tailNode < length - 1; tailNode++) {
int temp;
if (topNode >= length || array[headNode] < array[top... | java | private static void setExtendedParentPointers(final int[] array) {
final int length = array.length;
array[0] += array[1];
for (int headNode = 0, tailNode = 1, topNode = 2; tailNode < length - 1; tailNode++) {
int temp;
if (topNode >= length || array[headNode] < array[top... | [
"private",
"static",
"void",
"setExtendedParentPointers",
"(",
"final",
"int",
"[",
"]",
"array",
")",
"{",
"final",
"int",
"length",
"=",
"array",
".",
"length",
";",
"array",
"[",
"0",
"]",
"+=",
"array",
"[",
"1",
"]",
";",
"for",
"(",
"int",
"hea... | Fills the code array with extended parent pointers.
@param array The code length array | [
"Fills",
"the",
"code",
"array",
"with",
"extended",
"parent",
"pointers",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L59-L80 |
122,742 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.findNodesToRelocate | private static int findNodesToRelocate(final int[] array, final int maximumLength) {
int currentNode = array.length - 2;
for (int currentDepth = 1; currentDepth < maximumLength - 1 && currentNode > 1; currentDepth++) {
currentNode = first(array, currentNode - 1, 0);
}
return... | java | private static int findNodesToRelocate(final int[] array, final int maximumLength) {
int currentNode = array.length - 2;
for (int currentDepth = 1; currentDepth < maximumLength - 1 && currentNode > 1; currentDepth++) {
currentNode = first(array, currentNode - 1, 0);
}
return... | [
"private",
"static",
"int",
"findNodesToRelocate",
"(",
"final",
"int",
"[",
"]",
"array",
",",
"final",
"int",
"maximumLength",
")",
"{",
"int",
"currentNode",
"=",
"array",
".",
"length",
"-",
"2",
";",
"for",
"(",
"int",
"currentDepth",
"=",
"1",
";",... | Finds the number of nodes to relocate in order to achieve a given code length limit.
@param array The code length array
@param maximumLength The maximum bit length for the generated codes
@return The number of nodes to relocate | [
"Finds",
"the",
"number",
"of",
"nodes",
"to",
"relocate",
"in",
"order",
"to",
"achieve",
"a",
"given",
"code",
"length",
"limit",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L88-L94 |
122,743 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.allocateNodeLengths | private static void allocateNodeLengths(final int[] array) {
int firstNode = array.length - 2;
int nextNode = array.length - 1;
for (int currentDepth = 1, availableNodes = 2; availableNodes > 0; currentDepth++) {
final int lastNode = firstNode;
firstNode = first(array, l... | java | private static void allocateNodeLengths(final int[] array) {
int firstNode = array.length - 2;
int nextNode = array.length - 1;
for (int currentDepth = 1, availableNodes = 2; availableNodes > 0; currentDepth++) {
final int lastNode = firstNode;
firstNode = first(array, l... | [
"private",
"static",
"void",
"allocateNodeLengths",
"(",
"final",
"int",
"[",
"]",
"array",
")",
"{",
"int",
"firstNode",
"=",
"array",
".",
"length",
"-",
"2",
";",
"int",
"nextNode",
"=",
"array",
".",
"length",
"-",
"1",
";",
"for",
"(",
"int",
"c... | A final allocation pass with no code length limit.
@param array The code length array | [
"A",
"final",
"allocation",
"pass",
"with",
"no",
"code",
"length",
"limit",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L100-L114 |
122,744 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.allocateNodeLengthsWithRelocation | private static void allocateNodeLengthsWithRelocation(final int[] array,
final int nodesToMove, final int insertDepth) {
int firstNode = array.length - 2;
int nextNode = array.length - 1;
int currentDepth = insertDepth == 1 ? 2 : 1;
... | java | private static void allocateNodeLengthsWithRelocation(final int[] array,
final int nodesToMove, final int insertDepth) {
int firstNode = array.length - 2;
int nextNode = array.length - 1;
int currentDepth = insertDepth == 1 ? 2 : 1;
... | [
"private",
"static",
"void",
"allocateNodeLengthsWithRelocation",
"(",
"final",
"int",
"[",
"]",
"array",
",",
"final",
"int",
"nodesToMove",
",",
"final",
"int",
"insertDepth",
")",
"{",
"int",
"firstNode",
"=",
"array",
".",
"length",
"-",
"2",
";",
"int",... | A final allocation pass that relocates nodes in order to achieve a maximum code length limit.
@param array The code length array
@param nodesToMove The number of internal nodes to be relocated
@param insertDepth The depth at which to insert relocated nodes | [
"A",
"final",
"allocation",
"pass",
"that",
"relocates",
"nodes",
"in",
"order",
"to",
"achieve",
"a",
"maximum",
"code",
"length",
"limit",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L122-L150 |
122,745 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.allocateHuffmanCodeLengths | static void allocateHuffmanCodeLengths(final int[] array, final int maximumLength) {
switch (array.length) {
case 2:
array[1] = 1;
// fall through
case 1:
array[0] = 1;
return;
}
/* Pass 1 : Set extended par... | java | static void allocateHuffmanCodeLengths(final int[] array, final int maximumLength) {
switch (array.length) {
case 2:
array[1] = 1;
// fall through
case 1:
array[0] = 1;
return;
}
/* Pass 1 : Set extended par... | [
"static",
"void",
"allocateHuffmanCodeLengths",
"(",
"final",
"int",
"[",
"]",
"array",
",",
"final",
"int",
"maximumLength",
")",
"{",
"switch",
"(",
"array",
".",
"length",
")",
"{",
"case",
"2",
":",
"array",
"[",
"1",
"]",
"=",
"1",
";",
"// fall t... | Allocates Canonical Huffman code lengths in place based on a sorted frequency array.
@param array On input, a sorted array of symbol frequencies; On output, an array of Canonical
Huffman code lengths
@param maximumLength The maximum code length. Must be at least {@code ceil(log2(array.length))} | [
"Allocates",
"Canonical",
"Huffman",
"code",
"lengths",
"in",
"place",
"based",
"on",
"a",
"sorted",
"frequency",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L158-L181 |
122,746 | netty/netty | transport-native-unix-common/src/main/java/io/netty/channel/unix/FileDescriptor.java | FileDescriptor.close | public void close() throws IOException {
for (;;) {
int state = this.state;
if (isClosed(state)) {
return;
}
// Once a close operation happens, the channel is considered shutdown.
if (casState(state, state | STATE_ALL_MASK)) {
... | java | public void close() throws IOException {
for (;;) {
int state = this.state;
if (isClosed(state)) {
return;
}
// Once a close operation happens, the channel is considered shutdown.
if (casState(state, state | STATE_ALL_MASK)) {
... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"for",
"(",
";",
";",
")",
"{",
"int",
"state",
"=",
"this",
".",
"state",
";",
"if",
"(",
"isClosed",
"(",
"state",
")",
")",
"{",
"return",
";",
"}",
"// Once a close operation happen... | Close the file descriptor. | [
"Close",
"the",
"file",
"descriptor",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-unix-common/src/main/java/io/netty/channel/unix/FileDescriptor.java#L100-L115 |
122,747 | netty/netty | transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java | CombinedChannelDuplexHandler.init | protected final void init(I inboundHandler, O outboundHandler) {
validate(inboundHandler, outboundHandler);
this.inboundHandler = inboundHandler;
this.outboundHandler = outboundHandler;
} | java | protected final void init(I inboundHandler, O outboundHandler) {
validate(inboundHandler, outboundHandler);
this.inboundHandler = inboundHandler;
this.outboundHandler = outboundHandler;
} | [
"protected",
"final",
"void",
"init",
"(",
"I",
"inboundHandler",
",",
"O",
"outboundHandler",
")",
"{",
"validate",
"(",
"inboundHandler",
",",
"outboundHandler",
")",
";",
"this",
".",
"inboundHandler",
"=",
"inboundHandler",
";",
"this",
".",
"outboundHandler... | Initialized this handler with the specified handlers.
@throws IllegalStateException if this handler was not constructed via the default constructor or
if this handler does not implement all required handler interfaces
@throws IllegalArgumentException if the specified handlers cannot be combined into one due to a confl... | [
"Initialized",
"this",
"handler",
"with",
"the",
"specified",
"handlers",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java#L68-L72 |
122,748 | netty/netty | common/src/main/java/io/netty/util/internal/StringUtil.java | StringUtil.commonSuffixOfLength | public static boolean commonSuffixOfLength(String s, String p, int len) {
return s != null && p != null && len >= 0 && s.regionMatches(s.length() - len, p, p.length() - len, len);
} | java | public static boolean commonSuffixOfLength(String s, String p, int len) {
return s != null && p != null && len >= 0 && s.regionMatches(s.length() - len, p, p.length() - len, len);
} | [
"public",
"static",
"boolean",
"commonSuffixOfLength",
"(",
"String",
"s",
",",
"String",
"p",
",",
"int",
"len",
")",
"{",
"return",
"s",
"!=",
"null",
"&&",
"p",
"!=",
"null",
"&&",
"len",
">=",
"0",
"&&",
"s",
".",
"regionMatches",
"(",
"s",
".",
... | Checks if two strings have the same suffix of specified length
@param s string
@param p string
@param len length of the common suffix
@return true if both s and p are not null and both have the same suffix. Otherwise - false | [
"Checks",
"if",
"two",
"strings",
"have",
"the",
"same",
"suffix",
"of",
"specified",
"length"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/StringUtil.java#L83-L85 |
122,749 | netty/netty | common/src/main/java/io/netty/util/internal/StringUtil.java | StringUtil.byteToHexString | public static <T extends Appendable> T byteToHexString(T buf, int value) {
try {
buf.append(byteToHexString(value));
} catch (IOException e) {
PlatformDependent.throwException(e);
}
return buf;
} | java | public static <T extends Appendable> T byteToHexString(T buf, int value) {
try {
buf.append(byteToHexString(value));
} catch (IOException e) {
PlatformDependent.throwException(e);
}
return buf;
} | [
"public",
"static",
"<",
"T",
"extends",
"Appendable",
">",
"T",
"byteToHexString",
"(",
"T",
"buf",
",",
"int",
"value",
")",
"{",
"try",
"{",
"buf",
".",
"append",
"(",
"byteToHexString",
"(",
"value",
")",
")",
";",
"}",
"catch",
"(",
"IOException",... | Converts the specified byte value into a hexadecimal integer and appends it to the specified buffer. | [
"Converts",
"the",
"specified",
"byte",
"value",
"into",
"a",
"hexadecimal",
"integer",
"and",
"appends",
"it",
"to",
"the",
"specified",
"buffer",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/StringUtil.java#L148-L155 |
122,750 | netty/netty | common/src/main/java/io/netty/util/internal/StringUtil.java | StringUtil.decodeHexByte | public static byte decodeHexByte(CharSequence s, int pos) {
int hi = decodeHexNibble(s.charAt(pos));
int lo = decodeHexNibble(s.charAt(pos + 1));
if (hi == -1 || lo == -1) {
throw new IllegalArgumentException(String.format(
"invalid hex byte '%s' at index %d of '%... | java | public static byte decodeHexByte(CharSequence s, int pos) {
int hi = decodeHexNibble(s.charAt(pos));
int lo = decodeHexNibble(s.charAt(pos + 1));
if (hi == -1 || lo == -1) {
throw new IllegalArgumentException(String.format(
"invalid hex byte '%s' at index %d of '%... | [
"public",
"static",
"byte",
"decodeHexByte",
"(",
"CharSequence",
"s",
",",
"int",
"pos",
")",
"{",
"int",
"hi",
"=",
"decodeHexNibble",
"(",
"s",
".",
"charAt",
"(",
"pos",
")",
")",
";",
"int",
"lo",
"=",
"decodeHexNibble",
"(",
"s",
".",
"charAt",
... | Decode a 2-digit hex byte from within a string. | [
"Decode",
"a",
"2",
"-",
"digit",
"hex",
"byte",
"from",
"within",
"a",
"string",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/StringUtil.java#L230-L238 |
122,751 | netty/netty | handler-proxy/src/main/java/io/netty/handler/proxy/ProxyHandler.java | ProxyHandler.exceptionMessage | protected final String exceptionMessage(String msg) {
if (msg == null) {
msg = "";
}
StringBuilder buf = new StringBuilder(128 + msg.length())
.append(protocol())
.append(", ")
.append(authScheme())
.append(", ")
.append(pr... | java | protected final String exceptionMessage(String msg) {
if (msg == null) {
msg = "";
}
StringBuilder buf = new StringBuilder(128 + msg.length())
.append(protocol())
.append(", ")
.append(authScheme())
.append(", ")
.append(pr... | [
"protected",
"final",
"String",
"exceptionMessage",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"msg",
"=",
"\"\"",
";",
"}",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"128",
"+",
"msg",
".",
"length",
"(",... | Decorates the specified exception message with the common information such as the current protocol,
authentication scheme, proxy address, and destination address. | [
"Decorates",
"the",
"specified",
"exception",
"message",
"with",
"the",
"common",
"information",
"such",
"as",
"the",
"current",
"protocol",
"authentication",
"scheme",
"proxy",
"address",
"and",
"destination",
"address",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler-proxy/src/main/java/io/netty/handler/proxy/ProxyHandler.java#L371-L389 |
122,752 | netty/netty | example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java | HexDumpProxyFrontendHandler.closeOnFlush | static void closeOnFlush(Channel ch) {
if (ch.isActive()) {
ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
}
} | java | static void closeOnFlush(Channel ch) {
if (ch.isActive()) {
ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
}
} | [
"static",
"void",
"closeOnFlush",
"(",
"Channel",
"ch",
")",
"{",
"if",
"(",
"ch",
".",
"isActive",
"(",
")",
")",
"{",
"ch",
".",
"writeAndFlush",
"(",
"Unpooled",
".",
"EMPTY_BUFFER",
")",
".",
"addListener",
"(",
"ChannelFutureListener",
".",
"CLOSE",
... | Closes the specified channel after all queued write requests are flushed. | [
"Closes",
"the",
"specified",
"channel",
"after",
"all",
"queued",
"write",
"requests",
"are",
"flushed",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java#L100-L104 |
122,753 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.query | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
DnsQuestion question, Iterable<DnsRecord> additionals) {
return query(nextNameServerAddress(), question, additionals);
} | java | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
DnsQuestion question, Iterable<DnsRecord> additionals) {
return query(nextNameServerAddress(), question, additionals);
} | [
"public",
"Future",
"<",
"AddressedEnvelope",
"<",
"DnsResponse",
",",
"InetSocketAddress",
">",
">",
"query",
"(",
"DnsQuestion",
"question",
",",
"Iterable",
"<",
"DnsRecord",
">",
"additionals",
")",
"{",
"return",
"query",
"(",
"nextNameServerAddress",
"(",
... | Sends a DNS query with the specified question with additional records. | [
"Sends",
"a",
"DNS",
"query",
"with",
"the",
"specified",
"question",
"with",
"additional",
"records",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L1050-L1053 |
122,754 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.query | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
InetSocketAddress nameServerAddr, DnsQuestion question) {
return query0(nameServerAddr, question, EMPTY_ADDITIONALS, true, ch.newPromise(),
ch.eventLoop().<AddressedEnvelope<? extends DnsResponse, InetSock... | java | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
InetSocketAddress nameServerAddr, DnsQuestion question) {
return query0(nameServerAddr, question, EMPTY_ADDITIONALS, true, ch.newPromise(),
ch.eventLoop().<AddressedEnvelope<? extends DnsResponse, InetSock... | [
"public",
"Future",
"<",
"AddressedEnvelope",
"<",
"DnsResponse",
",",
"InetSocketAddress",
">",
">",
"query",
"(",
"InetSocketAddress",
"nameServerAddr",
",",
"DnsQuestion",
"question",
")",
"{",
"return",
"query0",
"(",
"nameServerAddr",
",",
"question",
",",
"E... | Sends a DNS query with the specified question using the specified name server list. | [
"Sends",
"a",
"DNS",
"query",
"with",
"the",
"specified",
"question",
"using",
"the",
"specified",
"name",
"server",
"list",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L1070-L1075 |
122,755 | netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.query | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
InetSocketAddress nameServerAddr, DnsQuestion question, Iterable<DnsRecord> additionals) {
return query0(nameServerAddr, question, toArray(additionals, false), true, ch.newPromise(),
ch.eventLoop().<Address... | java | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
InetSocketAddress nameServerAddr, DnsQuestion question, Iterable<DnsRecord> additionals) {
return query0(nameServerAddr, question, toArray(additionals, false), true, ch.newPromise(),
ch.eventLoop().<Address... | [
"public",
"Future",
"<",
"AddressedEnvelope",
"<",
"DnsResponse",
",",
"InetSocketAddress",
">",
">",
"query",
"(",
"InetSocketAddress",
"nameServerAddr",
",",
"DnsQuestion",
"question",
",",
"Iterable",
"<",
"DnsRecord",
">",
"additionals",
")",
"{",
"return",
"q... | Sends a DNS query with the specified question with additional records using the specified name server list. | [
"Sends",
"a",
"DNS",
"query",
"with",
"the",
"specified",
"question",
"with",
"additional",
"records",
"using",
"the",
"specified",
"name",
"server",
"list",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L1080-L1085 |
122,756 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java | HpackStaticTable.getIndex | static int getIndex(CharSequence name) {
Integer index = STATIC_INDEX_BY_NAME.get(name);
if (index == null) {
return -1;
}
return index;
} | java | static int getIndex(CharSequence name) {
Integer index = STATIC_INDEX_BY_NAME.get(name);
if (index == null) {
return -1;
}
return index;
} | [
"static",
"int",
"getIndex",
"(",
"CharSequence",
"name",
")",
"{",
"Integer",
"index",
"=",
"STATIC_INDEX_BY_NAME",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"index",
";",
... | Returns the lowest index value for the given header field name in the static table. Returns
-1 if the header field name is not in the static table. | [
"Returns",
"the",
"lowest",
"index",
"value",
"for",
"the",
"given",
"header",
"field",
"name",
"in",
"the",
"static",
"table",
".",
"Returns",
"-",
"1",
"if",
"the",
"header",
"field",
"name",
"is",
"not",
"in",
"the",
"static",
"table",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java#L136-L142 |
122,757 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java | HpackStaticTable.getIndex | static int getIndex(CharSequence name, CharSequence value) {
int index = getIndex(name);
if (index == -1) {
return -1;
}
// Note this assumes all entries for a given header field are sequential.
while (index <= length) {
HpackHeaderField entry = getEntry(... | java | static int getIndex(CharSequence name, CharSequence value) {
int index = getIndex(name);
if (index == -1) {
return -1;
}
// Note this assumes all entries for a given header field are sequential.
while (index <= length) {
HpackHeaderField entry = getEntry(... | [
"static",
"int",
"getIndex",
"(",
"CharSequence",
"name",
",",
"CharSequence",
"value",
")",
"{",
"int",
"index",
"=",
"getIndex",
"(",
"name",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// Note this assumes ... | Returns the index value for the given header field in the static table. Returns -1 if the
header field is not in the static table. | [
"Returns",
"the",
"index",
"value",
"for",
"the",
"given",
"header",
"field",
"in",
"the",
"static",
"table",
".",
"Returns",
"-",
"1",
"if",
"the",
"header",
"field",
"is",
"not",
"in",
"the",
"static",
"table",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java#L148-L167 |
122,758 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java | HpackStaticTable.createMap | private static CharSequenceMap<Integer> createMap() {
int length = STATIC_TABLE.size();
@SuppressWarnings("unchecked")
CharSequenceMap<Integer> ret = new CharSequenceMap<Integer>(true,
UnsupportedValueConverter.<Integer>instance(), length);
// Iterate through the static t... | java | private static CharSequenceMap<Integer> createMap() {
int length = STATIC_TABLE.size();
@SuppressWarnings("unchecked")
CharSequenceMap<Integer> ret = new CharSequenceMap<Integer>(true,
UnsupportedValueConverter.<Integer>instance(), length);
// Iterate through the static t... | [
"private",
"static",
"CharSequenceMap",
"<",
"Integer",
">",
"createMap",
"(",
")",
"{",
"int",
"length",
"=",
"STATIC_TABLE",
".",
"size",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"CharSequenceMap",
"<",
"Integer",
">",
"ret",
"=",... | create a map CharSequenceMap header name to index value to allow quick lookup | [
"create",
"a",
"map",
"CharSequenceMap",
"header",
"name",
"to",
"index",
"value",
"to",
"allow",
"quick",
"lookup"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java#L170-L183 |
122,759 | netty/netty | common/src/main/java/io/netty/util/ResourceLeakDetector.java | ResourceLeakDetector.reportUntracedLeak | protected void reportUntracedLeak(String resourceType) {
logger.error("LEAK: {}.release() was not called before it's garbage-collected. " +
"Enable advanced leak reporting to find out where the leak occurred. " +
"To enable advanced leak reporting, " +
"specify th... | java | protected void reportUntracedLeak(String resourceType) {
logger.error("LEAK: {}.release() was not called before it's garbage-collected. " +
"Enable advanced leak reporting to find out where the leak occurred. " +
"To enable advanced leak reporting, " +
"specify th... | [
"protected",
"void",
"reportUntracedLeak",
"(",
"String",
"resourceType",
")",
"{",
"logger",
".",
"error",
"(",
"\"LEAK: {}.release() was not called before it's garbage-collected. \"",
"+",
"\"Enable advanced leak reporting to find out where the leak occurred. \"",
"+",
"\"To enable... | This method is called when an untraced leak is detected. It can be overridden for tracking how many times leaks
have been detected. | [
"This",
"method",
"is",
"called",
"when",
"an",
"untraced",
"leak",
"is",
"detected",
".",
"It",
"can",
"be",
"overridden",
"for",
"tracking",
"how",
"many",
"times",
"leaks",
"have",
"been",
"detected",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ResourceLeakDetector.java#L327-L334 |
122,760 | netty/netty | handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java | TrafficCounter.stop | public synchronized void stop() {
if (!monitorActive) {
return;
}
monitorActive = false;
resetAccounting(milliSecondFromNano());
if (trafficShapingHandler != null) {
trafficShapingHandler.doAccounting(this);
}
if (scheduledFuture != null) {... | java | public synchronized void stop() {
if (!monitorActive) {
return;
}
monitorActive = false;
resetAccounting(milliSecondFromNano());
if (trafficShapingHandler != null) {
trafficShapingHandler.doAccounting(this);
}
if (scheduledFuture != null) {... | [
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"monitorActive",
")",
"{",
"return",
";",
"}",
"monitorActive",
"=",
"false",
";",
"resetAccounting",
"(",
"milliSecondFromNano",
"(",
")",
")",
";",
"if",
"(",
"trafficShapingHandler",... | Stop the monitoring process. | [
"Stop",
"the",
"monitoring",
"process",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L202-L214 |
122,761 | netty/netty | handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java | TrafficCounter.resetAccounting | synchronized void resetAccounting(long newLastTime) {
long interval = newLastTime - lastTime.getAndSet(newLastTime);
if (interval == 0) {
// nothing to do
return;
}
if (logger.isDebugEnabled() && interval > checkInterval() << 1) {
logger.debug("Acct sc... | java | synchronized void resetAccounting(long newLastTime) {
long interval = newLastTime - lastTime.getAndSet(newLastTime);
if (interval == 0) {
// nothing to do
return;
}
if (logger.isDebugEnabled() && interval > checkInterval() << 1) {
logger.debug("Acct sc... | [
"synchronized",
"void",
"resetAccounting",
"(",
"long",
"newLastTime",
")",
"{",
"long",
"interval",
"=",
"newLastTime",
"-",
"lastTime",
".",
"getAndSet",
"(",
"newLastTime",
")",
";",
"if",
"(",
"interval",
"==",
"0",
")",
"{",
"// nothing to do",
"return",
... | Reset the accounting on Read and Write.
@param newLastTime the milliseconds unix timestamp that we should be considered up-to-date for. | [
"Reset",
"the",
"accounting",
"on",
"Read",
"and",
"Write",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L221-L239 |
122,762 | netty/netty | handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java | TrafficCounter.configure | public void configure(long newCheckInterval) {
long newInterval = newCheckInterval / 10 * 10;
if (checkInterval.getAndSet(newInterval) != newInterval) {
if (newInterval <= 0) {
stop();
// No more active monitoring
lastTime.set(milliSecondFromNa... | java | public void configure(long newCheckInterval) {
long newInterval = newCheckInterval / 10 * 10;
if (checkInterval.getAndSet(newInterval) != newInterval) {
if (newInterval <= 0) {
stop();
// No more active monitoring
lastTime.set(milliSecondFromNa... | [
"public",
"void",
"configure",
"(",
"long",
"newCheckInterval",
")",
"{",
"long",
"newInterval",
"=",
"newCheckInterval",
"/",
"10",
"*",
"10",
";",
"if",
"(",
"checkInterval",
".",
"getAndSet",
"(",
"newInterval",
")",
"!=",
"newInterval",
")",
"{",
"if",
... | Change checkInterval between two computations in millisecond.
@param newCheckInterval The new check interval (in milliseconds) | [
"Change",
"checkInterval",
"between",
"two",
"computations",
"in",
"millisecond",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L312-L324 |
122,763 | netty/netty | buffer/src/main/java/io/netty/buffer/PoolChunk.java | PoolChunk.updateParentsAlloc | private void updateParentsAlloc(int id) {
while (id > 1) {
int parentId = id >>> 1;
byte val1 = value(id);
byte val2 = value(id ^ 1);
byte val = val1 < val2 ? val1 : val2;
setValue(parentId, val);
id = parentId;
}
} | java | private void updateParentsAlloc(int id) {
while (id > 1) {
int parentId = id >>> 1;
byte val1 = value(id);
byte val2 = value(id ^ 1);
byte val = val1 < val2 ? val1 : val2;
setValue(parentId, val);
id = parentId;
}
} | [
"private",
"void",
"updateParentsAlloc",
"(",
"int",
"id",
")",
"{",
"while",
"(",
"id",
">",
"1",
")",
"{",
"int",
"parentId",
"=",
"id",
">>>",
"1",
";",
"byte",
"val1",
"=",
"value",
"(",
"id",
")",
";",
"byte",
"val2",
"=",
"value",
"(",
"id"... | Update method used by allocate
This is triggered only when a successor is allocated and all its predecessors
need to update their state
The minimal depth at which subtree rooted at id has some free space
@param id id | [
"Update",
"method",
"used",
"by",
"allocate",
"This",
"is",
"triggered",
"only",
"when",
"a",
"successor",
"is",
"allocated",
"and",
"all",
"its",
"predecessors",
"need",
"to",
"update",
"their",
"state",
"The",
"minimal",
"depth",
"at",
"which",
"subtree",
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolChunk.java#L249-L258 |
122,764 | netty/netty | buffer/src/main/java/io/netty/buffer/PoolChunk.java | PoolChunk.allocateNode | private int allocateNode(int d) {
int id = 1;
int initial = - (1 << d); // has last d bits = 0 and rest all = 1
byte val = value(id);
if (val > d) { // unusable
return -1;
}
while (val < d || (id & initial) == 0) { // id & initial == 1 << d for all ids at dept... | java | private int allocateNode(int d) {
int id = 1;
int initial = - (1 << d); // has last d bits = 0 and rest all = 1
byte val = value(id);
if (val > d) { // unusable
return -1;
}
while (val < d || (id & initial) == 0) { // id & initial == 1 << d for all ids at dept... | [
"private",
"int",
"allocateNode",
"(",
"int",
"d",
")",
"{",
"int",
"id",
"=",
"1",
";",
"int",
"initial",
"=",
"-",
"(",
"1",
"<<",
"d",
")",
";",
"// has last d bits = 0 and rest all = 1",
"byte",
"val",
"=",
"value",
"(",
"id",
")",
";",
"if",
"("... | Algorithm to allocate an index in memoryMap when we query for a free node
at depth d
@param d depth
@return index in memoryMap | [
"Algorithm",
"to",
"allocate",
"an",
"index",
"in",
"memoryMap",
"when",
"we",
"query",
"for",
"a",
"free",
"node",
"at",
"depth",
"d"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolChunk.java#L293-L314 |
122,765 | netty/netty | buffer/src/main/java/io/netty/buffer/PoolChunk.java | PoolChunk.free | void free(long handle, ByteBuffer nioBuffer) {
int memoryMapIdx = memoryMapIdx(handle);
int bitmapIdx = bitmapIdx(handle);
if (bitmapIdx != 0) { // free a subpage
PoolSubpage<T> subpage = subpages[subpageIdx(memoryMapIdx)];
assert subpage != null && subpage.doNotDestroy;... | java | void free(long handle, ByteBuffer nioBuffer) {
int memoryMapIdx = memoryMapIdx(handle);
int bitmapIdx = bitmapIdx(handle);
if (bitmapIdx != 0) { // free a subpage
PoolSubpage<T> subpage = subpages[subpageIdx(memoryMapIdx)];
assert subpage != null && subpage.doNotDestroy;... | [
"void",
"free",
"(",
"long",
"handle",
",",
"ByteBuffer",
"nioBuffer",
")",
"{",
"int",
"memoryMapIdx",
"=",
"memoryMapIdx",
"(",
"handle",
")",
";",
"int",
"bitmapIdx",
"=",
"bitmapIdx",
"(",
"handle",
")",
";",
"if",
"(",
"bitmapIdx",
"!=",
"0",
")",
... | Free a subpage or a run of pages
When a subpage is freed from PoolSubpage, it might be added back to subpage pool of the owning PoolArena
If the subpage pool in PoolArena has at least one other PoolSubpage of given elemSize, we can
completely free the owning Page so it is available for subsequent allocations
@param ha... | [
"Free",
"a",
"subpage",
"or",
"a",
"run",
"of",
"pages",
"When",
"a",
"subpage",
"is",
"freed",
"from",
"PoolSubpage",
"it",
"might",
"be",
"added",
"back",
"to",
"subpage",
"pool",
"of",
"the",
"owning",
"PoolArena",
"If",
"the",
"subpage",
"pool",
"in"... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolChunk.java#L375-L400 |
122,766 | netty/netty | codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoder.java | ProtobufVarint32FrameDecoder.readRawVarint32 | private static int readRawVarint32(ByteBuf buffer) {
if (!buffer.isReadable()) {
return 0;
}
buffer.markReaderIndex();
byte tmp = buffer.readByte();
if (tmp >= 0) {
return tmp;
} else {
int result = tmp & 127;
if (!buffer.is... | java | private static int readRawVarint32(ByteBuf buffer) {
if (!buffer.isReadable()) {
return 0;
}
buffer.markReaderIndex();
byte tmp = buffer.readByte();
if (tmp >= 0) {
return tmp;
} else {
int result = tmp & 127;
if (!buffer.is... | [
"private",
"static",
"int",
"readRawVarint32",
"(",
"ByteBuf",
"buffer",
")",
"{",
"if",
"(",
"!",
"buffer",
".",
"isReadable",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"buffer",
".",
"markReaderIndex",
"(",
")",
";",
"byte",
"tmp",
"=",
"buffer",
... | Reads variable length 32bit int from buffer
@return decoded int if buffers readerIndex has been forwarded else nonsense value | [
"Reads",
"variable",
"length",
"32bit",
"int",
"from",
"buffer"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoder.java#L73-L120 |
122,767 | netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/Native.java | Native.splice | public static int splice(int fd, long offIn, int fdOut, long offOut, long len) throws IOException {
int res = splice0(fd, offIn, fdOut, offOut, len);
if (res >= 0) {
return res;
}
return ioResult("splice", res, SPLICE_CONNECTION_RESET_EXCEPTION, SPLICE_CLOSED_CHANNEL_EXCEPTIO... | java | public static int splice(int fd, long offIn, int fdOut, long offOut, long len) throws IOException {
int res = splice0(fd, offIn, fdOut, offOut, len);
if (res >= 0) {
return res;
}
return ioResult("splice", res, SPLICE_CONNECTION_RESET_EXCEPTION, SPLICE_CLOSED_CHANNEL_EXCEPTIO... | [
"public",
"static",
"int",
"splice",
"(",
"int",
"fd",
",",
"long",
"offIn",
",",
"int",
"fdOut",
",",
"long",
"offOut",
",",
"long",
"len",
")",
"throws",
"IOException",
"{",
"int",
"res",
"=",
"splice0",
"(",
"fd",
",",
"offIn",
",",
"fdOut",
",",
... | File-descriptor operations | [
"File",
"-",
"descriptor",
"operations"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/Native.java#L163-L169 |
122,768 | netty/netty | codec/src/main/java/io/netty/handler/codec/CodecOutputList.java | CodecOutputList.recycle | void recycle() {
for (int i = 0 ; i < size; i ++) {
array[i] = null;
}
size = 0;
insertSinceRecycled = false;
recycler.recycle(this);
} | java | void recycle() {
for (int i = 0 ; i < size; i ++) {
array[i] = null;
}
size = 0;
insertSinceRecycled = false;
recycler.recycle(this);
} | [
"void",
"recycle",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"array",
"[",
"i",
"]",
"=",
"null",
";",
"}",
"size",
"=",
"0",
";",
"insertSinceRecycled",
"=",
"false",
";",
"recycler",
"... | Recycle the array which will clear it and null out all entries in the internal storage. | [
"Recycle",
"the",
"array",
"which",
"will",
"clear",
"it",
"and",
"null",
"out",
"all",
"entries",
"in",
"the",
"internal",
"storage",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/CodecOutputList.java#L190-L198 |
122,769 | netty/netty | codec-memcache/src/main/java/io/netty/handler/codec/memcache/AbstractMemcacheObjectEncoder.java | AbstractMemcacheObjectEncoder.contentLength | private static int contentLength(Object msg) {
if (msg instanceof MemcacheContent) {
return ((MemcacheContent) msg).content().readableBytes();
}
if (msg instanceof ByteBuf) {
return ((ByteBuf) msg).readableBytes();
}
if (msg instanceof FileRegion) {
... | java | private static int contentLength(Object msg) {
if (msg instanceof MemcacheContent) {
return ((MemcacheContent) msg).content().readableBytes();
}
if (msg instanceof ByteBuf) {
return ((ByteBuf) msg).readableBytes();
}
if (msg instanceof FileRegion) {
... | [
"private",
"static",
"int",
"contentLength",
"(",
"Object",
"msg",
")",
"{",
"if",
"(",
"msg",
"instanceof",
"MemcacheContent",
")",
"{",
"return",
"(",
"(",
"MemcacheContent",
")",
"msg",
")",
".",
"content",
"(",
")",
".",
"readableBytes",
"(",
")",
";... | Determine the content length of the given object.
@param msg the object to determine the length of.
@return the determined content length. | [
"Determine",
"the",
"content",
"length",
"of",
"the",
"given",
"object",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-memcache/src/main/java/io/netty/handler/codec/memcache/AbstractMemcacheObjectEncoder.java#L84-L95 |
122,770 | netty/netty | common/src/main/java/io/netty/util/DomainNameMapping.java | DomainNameMapping.normalizeHostname | static String normalizeHostname(String hostname) {
if (needsNormalization(hostname)) {
hostname = IDN.toASCII(hostname, IDN.ALLOW_UNASSIGNED);
}
return hostname.toLowerCase(Locale.US);
} | java | static String normalizeHostname(String hostname) {
if (needsNormalization(hostname)) {
hostname = IDN.toASCII(hostname, IDN.ALLOW_UNASSIGNED);
}
return hostname.toLowerCase(Locale.US);
} | [
"static",
"String",
"normalizeHostname",
"(",
"String",
"hostname",
")",
"{",
"if",
"(",
"needsNormalization",
"(",
"hostname",
")",
")",
"{",
"hostname",
"=",
"IDN",
".",
"toASCII",
"(",
"hostname",
",",
"IDN",
".",
"ALLOW_UNASSIGNED",
")",
";",
"}",
"ret... | IDNA ASCII conversion and case normalization | [
"IDNA",
"ASCII",
"conversion",
"and",
"case",
"normalization"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/DomainNameMapping.java#L107-L112 |
122,771 | netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java | HpackDecoder.setMaxHeaderTableSize | public void setMaxHeaderTableSize(long maxHeaderTableSize) throws Http2Exception {
if (maxHeaderTableSize < MIN_HEADER_TABLE_SIZE || maxHeaderTableSize > MAX_HEADER_TABLE_SIZE) {
throw connectionError(PROTOCOL_ERROR, "Header Table Size must be >= %d and <= %d but was %d",
MIN_HEA... | java | public void setMaxHeaderTableSize(long maxHeaderTableSize) throws Http2Exception {
if (maxHeaderTableSize < MIN_HEADER_TABLE_SIZE || maxHeaderTableSize > MAX_HEADER_TABLE_SIZE) {
throw connectionError(PROTOCOL_ERROR, "Header Table Size must be >= %d and <= %d but was %d",
MIN_HEA... | [
"public",
"void",
"setMaxHeaderTableSize",
"(",
"long",
"maxHeaderTableSize",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"maxHeaderTableSize",
"<",
"MIN_HEADER_TABLE_SIZE",
"||",
"maxHeaderTableSize",
">",
"MAX_HEADER_TABLE_SIZE",
")",
"{",
"throw",
"connectionError... | Set the maximum table size. If this is below the maximum size of the dynamic table used by
the encoder, the beginning of the next header block MUST signal this change. | [
"Set",
"the",
"maximum",
"table",
"size",
".",
"If",
"this",
"is",
"below",
"the",
"maximum",
"size",
"of",
"the",
"dynamic",
"table",
"used",
"by",
"the",
"encoder",
"the",
"beginning",
"of",
"the",
"next",
"header",
"block",
"MUST",
"signal",
"this",
"... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java#L305-L317 |
122,772 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/LzmaFrameEncoder.java | LzmaFrameEncoder.maxOutputBufferLength | private static int maxOutputBufferLength(int inputLength) {
double factor;
if (inputLength < 200) {
factor = 1.5;
} else if (inputLength < 500) {
factor = 1.2;
} else if (inputLength < 1000) {
factor = 1.1;
} else if (inputLength < 10000) {
... | java | private static int maxOutputBufferLength(int inputLength) {
double factor;
if (inputLength < 200) {
factor = 1.5;
} else if (inputLength < 500) {
factor = 1.2;
} else if (inputLength < 1000) {
factor = 1.1;
} else if (inputLength < 10000) {
... | [
"private",
"static",
"int",
"maxOutputBufferLength",
"(",
"int",
"inputLength",
")",
"{",
"double",
"factor",
";",
"if",
"(",
"inputLength",
"<",
"200",
")",
"{",
"factor",
"=",
"1.5",
";",
"}",
"else",
"if",
"(",
"inputLength",
"<",
"500",
")",
"{",
"... | Calculates maximum possible size of output buffer for not compressible data. | [
"Calculates",
"maximum",
"possible",
"size",
"of",
"output",
"buffer",
"for",
"not",
"compressible",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/LzmaFrameEncoder.java#L207-L221 |
122,773 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java | WebSocketServerHandshaker00.close | @Override
public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
return channel.writeAndFlush(frame, promise);
} | java | @Override
public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
return channel.writeAndFlush(frame, promise);
} | [
"@",
"Override",
"public",
"ChannelFuture",
"close",
"(",
"Channel",
"channel",
",",
"CloseWebSocketFrame",
"frame",
",",
"ChannelPromise",
"promise",
")",
"{",
"return",
"channel",
".",
"writeAndFlush",
"(",
"frame",
",",
"promise",
")",
";",
"}"
] | Echo back the closing frame
@param channel
Channel
@param frame
Web Socket frame that was received | [
"Echo",
"back",
"the",
"closing",
"frame"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java#L185-L188 |
122,774 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.setBodyHttpDatas | public void setBodyHttpDatas(List<InterfaceHttpData> datas) throws ErrorDataEncoderException {
if (datas == null) {
throw new NullPointerException("datas");
}
globalBodySize = 0;
bodyListDatas.clear();
currentFileUpload = null;
duringMixedMode = false;
... | java | public void setBodyHttpDatas(List<InterfaceHttpData> datas) throws ErrorDataEncoderException {
if (datas == null) {
throw new NullPointerException("datas");
}
globalBodySize = 0;
bodyListDatas.clear();
currentFileUpload = null;
duringMixedMode = false;
... | [
"public",
"void",
"setBodyHttpDatas",
"(",
"List",
"<",
"InterfaceHttpData",
">",
"datas",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"datas",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"datas\"",
")",
";",
"}",
"gl... | Set the Body HttpDatas list
@throws NullPointerException
for datas
@throws ErrorDataEncoderException
if the encoding is in error or if the finalize were already done | [
"Set",
"the",
"Body",
"HttpDatas",
"list"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L312-L324 |
122,775 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyAttribute | public void addBodyAttribute(String name, String value) throws ErrorDataEncoderException {
String svalue = value != null? value : StringUtil.EMPTY_STRING;
Attribute data = factory.createAttribute(request, checkNotNull(name, "name"), svalue);
addBodyHttpData(data);
} | java | public void addBodyAttribute(String name, String value) throws ErrorDataEncoderException {
String svalue = value != null? value : StringUtil.EMPTY_STRING;
Attribute data = factory.createAttribute(request, checkNotNull(name, "name"), svalue);
addBodyHttpData(data);
} | [
"public",
"void",
"addBodyAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"ErrorDataEncoderException",
"{",
"String",
"svalue",
"=",
"value",
"!=",
"null",
"?",
"value",
":",
"StringUtil",
".",
"EMPTY_STRING",
";",
"Attribute",
"data",
... | Add a simple attribute in the body as Name=Value
@param name
name of the parameter
@param value
the value of the parameter
@throws NullPointerException
for name
@throws ErrorDataEncoderException
if the encoding is in error or if the finalize were already done | [
"Add",
"a",
"simple",
"attribute",
"in",
"the",
"body",
"as",
"Name",
"=",
"Value"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L338-L342 |
122,776 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyFileUploads | public void addBodyFileUploads(String name, File[] file, String[] contentType, boolean[] isText)
throws ErrorDataEncoderException {
if (file.length != contentType.length && file.length != isText.length) {
throw new IllegalArgumentException("Different array length");
}
for... | java | public void addBodyFileUploads(String name, File[] file, String[] contentType, boolean[] isText)
throws ErrorDataEncoderException {
if (file.length != contentType.length && file.length != isText.length) {
throw new IllegalArgumentException("Different array length");
}
for... | [
"public",
"void",
"addBodyFileUploads",
"(",
"String",
"name",
",",
"File",
"[",
"]",
"file",
",",
"String",
"[",
"]",
"contentType",
",",
"boolean",
"[",
"]",
"isText",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"file",
".",
"length",
"!=... | Add a series of Files associated with one File parameter
@param name
the name of the parameter
@param file
the array of files
@param contentType
the array of content Types associated with each file
@param isText
the array of isText attribute (False meaning binary mode) for each file
@throws IllegalArgumentException
al... | [
"Add",
"a",
"series",
"of",
"Files",
"associated",
"with",
"one",
"File",
"parameter"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L429-L437 |
122,777 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.encodeAttribute | @SuppressWarnings("unchecked")
private String encodeAttribute(String s, Charset charset) throws ErrorDataEncoderException {
if (s == null) {
return "";
}
try {
String encoded = URLEncoder.encode(s, charset.name());
if (encoderMode == EncoderMode.RFC3986) {... | java | @SuppressWarnings("unchecked")
private String encodeAttribute(String s, Charset charset) throws ErrorDataEncoderException {
if (s == null) {
return "";
}
try {
String encoded = URLEncoder.encode(s, charset.name());
if (encoderMode == EncoderMode.RFC3986) {... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"String",
"encodeAttribute",
"(",
"String",
"s",
",",
"Charset",
"charset",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"t... | Encode one attribute
@return the encoded attribute
@throws ErrorDataEncoderException
if the encoding is in error | [
"Encode",
"one",
"attribute"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L836-L853 |
122,778 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageDecoder.java | Bzip2HuffmanStageDecoder.createHuffmanDecodingTables | void createHuffmanDecodingTables() {
final int alphabetSize = this.alphabetSize;
for (int table = 0; table < tableCodeLengths.length; table++) {
final int[] tableBases = codeBases[table];
final int[] tableLimits = codeLimits[table];
final int[] tableSymbols = codeSym... | java | void createHuffmanDecodingTables() {
final int alphabetSize = this.alphabetSize;
for (int table = 0; table < tableCodeLengths.length; table++) {
final int[] tableBases = codeBases[table];
final int[] tableLimits = codeLimits[table];
final int[] tableSymbols = codeSym... | [
"void",
"createHuffmanDecodingTables",
"(",
")",
"{",
"final",
"int",
"alphabetSize",
"=",
"this",
".",
"alphabetSize",
";",
"for",
"(",
"int",
"table",
"=",
"0",
";",
"table",
"<",
"tableCodeLengths",
".",
"length",
";",
"table",
"++",
")",
"{",
"final",
... | Constructs Huffman decoding tables from lists of Canonical Huffman code lengths. | [
"Constructs",
"Huffman",
"decoding",
"tables",
"from",
"lists",
"of",
"Canonical",
"Huffman",
"code",
"lengths",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageDecoder.java#L115-L165 |
122,779 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageDecoder.java | Bzip2HuffmanStageDecoder.nextSymbol | int nextSymbol() {
// Move to next group selector if required
if (++groupPosition % HUFFMAN_GROUP_RUN_LENGTH == 0) {
groupIndex++;
if (groupIndex == selectors.length) {
throw new DecompressionException("error decoding block");
}
currentTabl... | java | int nextSymbol() {
// Move to next group selector if required
if (++groupPosition % HUFFMAN_GROUP_RUN_LENGTH == 0) {
groupIndex++;
if (groupIndex == selectors.length) {
throw new DecompressionException("error decoding block");
}
currentTabl... | [
"int",
"nextSymbol",
"(",
")",
"{",
"// Move to next group selector if required",
"if",
"(",
"++",
"groupPosition",
"%",
"HUFFMAN_GROUP_RUN_LENGTH",
"==",
"0",
")",
"{",
"groupIndex",
"++",
";",
"if",
"(",
"groupIndex",
"==",
"selectors",
".",
"length",
")",
"{"... | Decodes and returns the next symbol.
@return The decoded symbol | [
"Decodes",
"and",
"returns",
"the",
"next",
"symbol",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageDecoder.java#L171-L200 |
122,780 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.number | public long number() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionNumber(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long number() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionNumber(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"number",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionNumber",
"(",
"context",
".",
"c... | Returns the current number of sessions in the internal session cache. | [
"Returns",
"the",
"current",
"number",
"of",
"sessions",
"in",
"the",
"internal",
"session",
"cache",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L43-L51 |
122,781 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.connectRenegotiate | public long connectRenegotiate() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionConnectRenegotiate(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long connectRenegotiate() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionConnectRenegotiate(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"connectRenegotiate",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionConnectRenegotiate",
"(",
... | Returns the number of start renegotiations in client mode. | [
"Returns",
"the",
"number",
"of",
"start",
"renegotiations",
"in",
"client",
"mode",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L82-L90 |
122,782 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.acceptRenegotiate | public long acceptRenegotiate() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionAcceptRenegotiate(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long acceptRenegotiate() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionAcceptRenegotiate(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"acceptRenegotiate",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionAcceptRenegotiate",
"(",
... | Returns the number of start renegotiations in server mode. | [
"Returns",
"the",
"number",
"of",
"start",
"renegotiations",
"in",
"server",
"mode",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L121-L129 |
122,783 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.cbHits | public long cbHits() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionCbHits(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long cbHits() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionCbHits(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"cbHits",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionCbHits",
"(",
"context",
".",
"c... | Returns the number of successfully retrieved sessions from the external session cache in server mode. | [
"Returns",
"the",
"number",
"of",
"successfully",
"retrieved",
"sessions",
"from",
"the",
"external",
"session",
"cache",
"in",
"server",
"mode",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L149-L157 |
122,784 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.misses | public long misses() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionMisses(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long misses() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionMisses(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"misses",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionMisses",
"(",
"context",
".",
"c... | Returns the number of sessions proposed by clients that were not found in the internal session cache
in server mode. | [
"Returns",
"the",
"number",
"of",
"sessions",
"proposed",
"by",
"clients",
"that",
"were",
"not",
"found",
"in",
"the",
"internal",
"session",
"cache",
"in",
"server",
"mode",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L163-L171 |
122,785 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.cacheFull | public long cacheFull() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionCacheFull(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long cacheFull() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionCacheFull(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"cacheFull",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionCacheFull",
"(",
"context",
"."... | Returns the number of sessions that were removed because the maximum session cache size was exceeded. | [
"Returns",
"the",
"number",
"of",
"sessions",
"that",
"were",
"removed",
"because",
"the",
"maximum",
"session",
"cache",
"size",
"was",
"exceeded",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L191-L199 |
122,786 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.ticketKeyFail | public long ticketKeyFail() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyFail(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long ticketKeyFail() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyFail(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"ticketKeyFail",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionTicketKeyFail",
"(",
"context... | Returns the number of times a client presented a ticket that did not match any key in the list. | [
"Returns",
"the",
"number",
"of",
"times",
"a",
"client",
"presented",
"a",
"ticket",
"that",
"did",
"not",
"match",
"any",
"key",
"in",
"the",
"list",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L204-L212 |
122,787 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.ticketKeyNew | public long ticketKeyNew() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyNew(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long ticketKeyNew() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyNew(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"ticketKeyNew",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionTicketKeyNew",
"(",
"context",... | Returns the number of times a client did not present a ticket and we issued a new one | [
"Returns",
"the",
"number",
"of",
"times",
"a",
"client",
"did",
"not",
"present",
"a",
"ticket",
"and",
"we",
"issued",
"a",
"new",
"one"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L217-L225 |
122,788 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.ticketKeyRenew | public long ticketKeyRenew() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyRenew(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long ticketKeyRenew() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyRenew(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"ticketKeyRenew",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionTicketKeyRenew",
"(",
"conte... | Returns the number of times a client presented a ticket derived from an older key,
and we upgraded to the primary key. | [
"Returns",
"the",
"number",
"of",
"times",
"a",
"client",
"presented",
"a",
"ticket",
"derived",
"from",
"an",
"older",
"key",
"and",
"we",
"upgraded",
"to",
"the",
"primary",
"key",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L231-L239 |
122,789 | netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java | OpenSslSessionStats.ticketKeyResume | public long ticketKeyResume() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyResume(context.ctx);
} finally {
readerLock.unlock();
}
} | java | public long ticketKeyResume() {
Lock readerLock = context.ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.sessionTicketKeyResume(context.ctx);
} finally {
readerLock.unlock();
}
} | [
"public",
"long",
"ticketKeyResume",
"(",
")",
"{",
"Lock",
"readerLock",
"=",
"context",
".",
"ctxLock",
".",
"readLock",
"(",
")",
";",
"readerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"SSLContext",
".",
"sessionTicketKeyResume",
"(",
"con... | Returns the number of times a client presented a ticket derived from the primary key. | [
"Returns",
"the",
"number",
"of",
"times",
"a",
"client",
"presented",
"a",
"ticket",
"derived",
"from",
"the",
"primary",
"key",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L244-L252 |
122,790 | netty/netty | microbench/src/main/java/io/netty/buffer/ByteBufAccessBenchmark.java | ByteBufAccessBenchmark.setup | @Setup
public void setup() {
System.setProperty("io.netty.buffer.checkAccessible", checkAccessible);
System.setProperty("io.netty.buffer.checkBounds", checkBounds);
buffer = bufferType.newBuffer();
} | java | @Setup
public void setup() {
System.setProperty("io.netty.buffer.checkAccessible", checkAccessible);
System.setProperty("io.netty.buffer.checkBounds", checkBounds);
buffer = bufferType.newBuffer();
} | [
"@",
"Setup",
"public",
"void",
"setup",
"(",
")",
"{",
"System",
".",
"setProperty",
"(",
"\"io.netty.buffer.checkAccessible\"",
",",
"checkAccessible",
")",
";",
"System",
".",
"setProperty",
"(",
"\"io.netty.buffer.checkBounds\"",
",",
"checkBounds",
")",
";",
... | applies only to readBatch benchmark | [
"applies",
"only",
"to",
"readBatch",
"benchmark"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/microbench/src/main/java/io/netty/buffer/ByteBufAccessBenchmark.java#L122-L127 |
122,791 | netty/netty | handler/src/main/java/io/netty/handler/ssl/SslUtils.java | SslUtils.unsignedShortBE | @SuppressWarnings("deprecation")
private static int unsignedShortBE(ByteBuf buffer, int offset) {
return buffer.order() == ByteOrder.BIG_ENDIAN ?
buffer.getUnsignedShort(offset) : buffer.getUnsignedShortLE(offset);
} | java | @SuppressWarnings("deprecation")
private static int unsignedShortBE(ByteBuf buffer, int offset) {
return buffer.order() == ByteOrder.BIG_ENDIAN ?
buffer.getUnsignedShort(offset) : buffer.getUnsignedShortLE(offset);
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"static",
"int",
"unsignedShortBE",
"(",
"ByteBuf",
"buffer",
",",
"int",
"offset",
")",
"{",
"return",
"buffer",
".",
"order",
"(",
")",
"==",
"ByteOrder",
".",
"BIG_ENDIAN",
"?",
"buffer",
".... | 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/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L239-L243 |
122,792 | netty/netty | handler/src/main/java/io/netty/handler/ssl/SslUtils.java | SslUtils.isValidHostNameForSNI | static boolean isValidHostNameForSNI(String hostname) {
return hostname != null &&
hostname.indexOf('.') > 0 &&
!hostname.endsWith(".") &&
!NetUtil.isValidIpV4Address(hostname) &&
!NetUtil.isValidIpV6Address(hostname);
} | java | static boolean isValidHostNameForSNI(String hostname) {
return hostname != null &&
hostname.indexOf('.') > 0 &&
!hostname.endsWith(".") &&
!NetUtil.isValidIpV4Address(hostname) &&
!NetUtil.isValidIpV6Address(hostname);
} | [
"static",
"boolean",
"isValidHostNameForSNI",
"(",
"String",
"hostname",
")",
"{",
"return",
"hostname",
"!=",
"null",
"&&",
"hostname",
".",
"indexOf",
"(",
"'",
"'",
")",
">",
"0",
"&&",
"!",
"hostname",
".",
"endsWith",
"(",
"\".\"",
")",
"&&",
"!",
... | Validate that the given hostname can be used in SNI extension. | [
"Validate",
"that",
"the",
"given",
"hostname",
"can",
"be",
"used",
"in",
"SNI",
"extension",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L385-L391 |
122,793 | netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java | SpdySessionHandler.acceptStream | private boolean acceptStream(
int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) {
// Cannot initiate any new streams after receiving or sending GOAWAY
if (receivedGoAwayFrame || sentGoAwayFrame) {
return false;
}
boolean remote = isR... | java | private boolean acceptStream(
int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) {
// Cannot initiate any new streams after receiving or sending GOAWAY
if (receivedGoAwayFrame || sentGoAwayFrame) {
return false;
}
boolean remote = isR... | [
"private",
"boolean",
"acceptStream",
"(",
"int",
"streamId",
",",
"byte",
"priority",
",",
"boolean",
"remoteSideClosed",
",",
"boolean",
"localSideClosed",
")",
"{",
"// Cannot initiate any new streams after receiving or sending GOAWAY",
"if",
"(",
"receivedGoAwayFrame",
... | need to synchronize accesses to sentGoAwayFrame, lastGoodStreamId, and initial window sizes | [
"need",
"to",
"synchronize",
"accesses",
"to",
"sentGoAwayFrame",
"lastGoodStreamId",
"and",
"initial",
"window",
"sizes"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java#L713-L732 |
122,794 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.findMatchingLength | private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
int matched = 0;
while (inIndex <= maxIndex - 4 &&
in.getInt(inIndex) == in.getInt(minIndex + matched)) {
inIndex += 4;
matched += 4;
}
while (inIndex < ... | java | private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
int matched = 0;
while (inIndex <= maxIndex - 4 &&
in.getInt(inIndex) == in.getInt(minIndex + matched)) {
inIndex += 4;
matched += 4;
}
while (inIndex < ... | [
"private",
"static",
"int",
"findMatchingLength",
"(",
"ByteBuf",
"in",
",",
"int",
"minIndex",
",",
"int",
"inIndex",
",",
"int",
"maxIndex",
")",
"{",
"int",
"matched",
"=",
"0",
";",
"while",
"(",
"inIndex",
"<=",
"maxIndex",
"-",
"4",
"&&",
"in",
"... | Iterates over the supplied input buffer between the supplied minIndex and
maxIndex to find how long our matched copy overlaps with an already-written
literal value.
@param in The input buffer to scan over
@param minIndex The index in the input buffer to start scanning from
@param inIndex The index of the start of our ... | [
"Iterates",
"over",
"the",
"supplied",
"input",
"buffer",
"between",
"the",
"supplied",
"minIndex",
"and",
"maxIndex",
"to",
"find",
"how",
"long",
"our",
"matched",
"copy",
"overlaps",
"with",
"an",
"already",
"-",
"written",
"literal",
"value",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L179-L194 |
122,795 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.encodeLiteral | static void encodeLiteral(ByteBuf in, ByteBuf out, int length) {
if (length < 61) {
out.writeByte(length - 1 << 2);
} else {
int bitLength = bitsToEncode(length - 1);
int bytesToEncode = 1 + bitLength / 8;
out.writeByte(59 + bytesToEncode << 2);
... | java | static void encodeLiteral(ByteBuf in, ByteBuf out, int length) {
if (length < 61) {
out.writeByte(length - 1 << 2);
} else {
int bitLength = bitsToEncode(length - 1);
int bytesToEncode = 1 + bitLength / 8;
out.writeByte(59 + bytesToEncode << 2);
... | [
"static",
"void",
"encodeLiteral",
"(",
"ByteBuf",
"in",
",",
"ByteBuf",
"out",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"<",
"61",
")",
"{",
"out",
".",
"writeByte",
"(",
"length",
"-",
"1",
"<<",
"2",
")",
";",
"}",
"else",
"{",
"in... | Writes a literal to the supplied output buffer by directly copying from
the input buffer. The literal is taken from the current readerIndex
up to the supplied length.
@param in The input buffer to copy from
@param out The output buffer to copy to
@param length The length of the literal to copy | [
"Writes",
"a",
"literal",
"to",
"the",
"supplied",
"output",
"buffer",
"by",
"directly",
"copying",
"from",
"the",
"input",
"buffer",
".",
"The",
"literal",
"is",
"taken",
"from",
"the",
"current",
"readerIndex",
"up",
"to",
"the",
"supplied",
"length",
"."
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L223-L236 |
122,796 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.encodeCopy | private static void encodeCopy(ByteBuf out, int offset, int length) {
while (length >= 68) {
encodeCopyWithOffset(out, offset, 64);
length -= 64;
}
if (length > 64) {
encodeCopyWithOffset(out, offset, 60);
length -= 60;
}
encodeCo... | java | private static void encodeCopy(ByteBuf out, int offset, int length) {
while (length >= 68) {
encodeCopyWithOffset(out, offset, 64);
length -= 64;
}
if (length > 64) {
encodeCopyWithOffset(out, offset, 60);
length -= 60;
}
encodeCo... | [
"private",
"static",
"void",
"encodeCopy",
"(",
"ByteBuf",
"out",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"while",
"(",
"length",
">=",
"68",
")",
"{",
"encodeCopyWithOffset",
"(",
"out",
",",
"offset",
",",
"64",
")",
";",
"length",
"-="... | Encodes a series of copies, each at most 64 bytes in length.
@param out The output buffer to write the copy pointer to
@param offset The offset at which the original instance lies
@param length The length of the original instance | [
"Encodes",
"a",
"series",
"of",
"copies",
"each",
"at",
"most",
"64",
"bytes",
"in",
"length",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L256-L268 |
122,797 | netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.calculateChecksum | static int calculateChecksum(ByteBuf data, int offset, int length) {
Crc32c crc32 = new Crc32c();
try {
crc32.update(data, offset, length);
return maskChecksum((int) crc32.getValue());
} finally {
crc32.reset();
}
} | java | static int calculateChecksum(ByteBuf data, int offset, int length) {
Crc32c crc32 = new Crc32c();
try {
crc32.update(data, offset, length);
return maskChecksum((int) crc32.getValue());
} finally {
crc32.reset();
}
} | [
"static",
"int",
"calculateChecksum",
"(",
"ByteBuf",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"Crc32c",
"crc32",
"=",
"new",
"Crc32c",
"(",
")",
";",
"try",
"{",
"crc32",
".",
"update",
"(",
"data",
",",
"offset",
",",
"length",
... | Computes the CRC32C checksum of the supplied data and performs the "mask" operation
on the computed checksum
@param data The input data to calculate the CRC32C checksum of | [
"Computes",
"the",
"CRC32C",
"checksum",
"of",
"the",
"supplied",
"data",
"and",
"performs",
"the",
"mask",
"operation",
"on",
"the",
"computed",
"checksum"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L606-L614 |
122,798 | netty/netty | handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java | CipherSuiteConverter.isJ2OCached | static boolean isJ2OCached(String key, String value) {
return value.equals(j2o.get(key));
} | java | static boolean isJ2OCached(String key, String value) {
return value.equals(j2o.get(key));
} | [
"static",
"boolean",
"isJ2OCached",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"value",
".",
"equals",
"(",
"j2o",
".",
"get",
"(",
"key",
")",
")",
";",
"}"
] | Tests if the specified key-value pair has been cached in Java-to-OpenSSL cache. | [
"Tests",
"if",
"the",
"specified",
"key",
"-",
"value",
"pair",
"has",
"been",
"cached",
"in",
"Java",
"-",
"to",
"-",
"OpenSSL",
"cache",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L132-L134 |
122,799 | netty/netty | handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java | CipherSuiteConverter.isO2JCached | static boolean isO2JCached(String key, String protocol, String value) {
Map<String, String> p2j = o2j.get(key);
if (p2j == null) {
return false;
} else {
return value.equals(p2j.get(protocol));
}
} | java | static boolean isO2JCached(String key, String protocol, String value) {
Map<String, String> p2j = o2j.get(key);
if (p2j == null) {
return false;
} else {
return value.equals(p2j.get(protocol));
}
} | [
"static",
"boolean",
"isO2JCached",
"(",
"String",
"key",
",",
"String",
"protocol",
",",
"String",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"p2j",
"=",
"o2j",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"p2j",
"==",
"null",
")... | Tests if the specified key-value pair has been cached in OpenSSL-to-Java cache. | [
"Tests",
"if",
"the",
"specified",
"key",
"-",
"value",
"pair",
"has",
"been",
"cached",
"in",
"OpenSSL",
"-",
"to",
"-",
"Java",
"cache",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L139-L146 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.