Package org.jfree.fonts.encoding

Examples of org.jfree.fonts.encoding.Encoding


  public static String readString (final byte[] data, final int pos,
                                   final int length, final String encoding)
          throws EncodingException
  {
    final Encoding enc;
    if ("UTF-16".equals(encoding))
    {
      enc = EncodingRegistry.getInstance().getEncoding("UTF-16LE");
    }
    else
    {
      enc = EncodingRegistry.getInstance().getEncoding(encoding);
    }
    final ByteBuffer byteBuffer = new ByteBuffer(data, pos, length);
    final CodePointBuffer cp = enc.decode(byteBuffer, null);
    return Utf16LE.getInstance().encodeString(cp);
  }
View Full Code Here


//
  public static String readString (final byte[] data, final int pos,
                                   final int length, final String encoding)
          throws EncodingException
  {
    final Encoding enc;
    if ("UTF-16".equals(encoding))
    {
      enc = EncodingRegistry.getInstance().getEncoding("UTF-16LE");
    }
    else
    {
      enc = EncodingRegistry.getInstance().getEncoding(encoding);
    }
//    Log.debug ("Encoding: " + enc);
    final ByteBuffer byteBuffer = new ByteBuffer(data, pos, length);
    final CodePointBuffer cp = enc.decode(byteBuffer, null);
    return Utf16LE.getInstance().encodeString(cp);
  }
View Full Code Here

TOP

Related Classes of org.jfree.fonts.encoding.Encoding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.