Example usage for org.eclipse.jdt.internal.compiler.util Util bytesToChar

List of usage examples for org.eclipse.jdt.internal.compiler.util Util bytesToChar

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.util Util bytesToChar.

Prototype

public static char[] bytesToChar(byte[] bytes, String encoding) throws IOException 

Source Link

Document

Returns the given bytes as a char array using a given encoding (null means platform default).

Usage

From source file:org.eclipse.jdt.internal.core.SourceMapper.java

License:Open Source License

private char[] readSource(ZipEntry entry, ZipFile zip, String charSet) {
    try {//from   w  w w.j a  v  a 2  s . c  o m
        byte[] bytes = Util.getZipEntryByteContent(entry, zip);
        if (bytes != null) {
            return Util.bytesToChar(bytes, charSet == null ? this.encoding : charSet);
        }
    } catch (IOException e) {
        // ignore
    }
    return null;
}