List of usage examples for io.netty.util AsciiString cached
public static AsciiString cached(String string)
From source file:com.linecorp.armeria.common.HttpHeaderNames.java
License:Apache License
/** * Lower-cases and converts the specified header name into an {@link AsciiString}. If {@code name} is * a known header name, this method will return a pre-instantiated {@link AsciiString} to reduce * the allocation rate of {@link AsciiString}. *//*from w ww.j a va 2s . c o m*/ public static AsciiString of(String name) { name = Ascii.toLowerCase(requireNonNull(name, "name")); final AsciiString asciiName = map.get(name); return asciiName != null ? asciiName : AsciiString.cached(name); }
From source file:com.linecorp.armeria.common.HttpStatusClass.java
License:Apache License
HttpStatusClass(int min, int max, String defaultReasonPhrase) { this.min = min; this.max = max; this.defaultReasonPhrase = AsciiString.cached(defaultReasonPhrase); }