byteBuf = new byte[len]; oldPosition = buffer.position(); try { buffer.position(offset); buffer.get(byteBuf); try { return new String(byteBuf, charsetName); } catch (UnsupportedEncodingException uex) { } } finally { buffer.position(oldPosition); }  return null;
return decodeName(charsetName, buffer, offset, len);
  private static String decodeName(int platform, int encoding, int language,                                   ByteBuffer buffer, int offset, int len)  {    byte[] byteBuf;    String charsetName;    int oldPosition;    charsetName = getCharsetName(platform, language, encoding);    if (charsetName == null)      return null;    byteBuf = new byte[len];    oldPosition = buffer.position();    try    {      buffer.position(offset);      buffer.get(byteBuf);      try      {        return new String(byteBuf, charsetName);      }      catch (UnsupportedEncodingException uex)      {      }    }    finally    {      buffer.position(oldPosition);    }    return null;  }