Example usage for io.netty.util CharsetUtil getEncoder

List of usage examples for io.netty.util CharsetUtil getEncoder

Introduction

In this page you can find the example usage for io.netty.util CharsetUtil getEncoder.

Prototype

@Deprecated
public static CharsetEncoder getEncoder(Charset charset) 

Source Link

Usage

From source file:org.apache.tajo.util.StringUtils.java

License:Apache License

/**
 * Check Seven-bit ASCII//from   w  ww.  ja  v a2s .  co m
 */
public static boolean isPureAscii(String v) {
    // get thread-safe encoder
    CharsetEncoder asciiEncoder = CharsetUtil.getEncoder(CharsetUtil.US_ASCII);
    return asciiEncoder.canEncode(v);
}