src/main/java/com/spinyowl/legui/util/IOUtil.java
public static String byteBufferToString(ByteBuffer byteBuffer, Charset charset) {
    if (byteBuffer == null) {
      return null;
    }
    if (byteBuffer.limit() == 0) {
      return "";
    }
    byte[] buffer = new byte[byteBuffer.limit()];
    byteBuffer.get(buffer);
    return new String(buffer, charset);
  }
/**
   * Used to transfer buffer data to {@link String}.
   *
   * @param byteBuffer data to transfer
   * @return string or null.
   */
Used to transfer buffer data to  String.
@param byteBuffer data to transfer
@return string or null.
Used to transfer buffer data to String . @param byteBuffer data to transfer @return string or null .
public static String byteBufferToString(ByteBuffer byteBuffer, Charset charset) {
    if (byteBuffer == null) {
      return null;
    }
    if (byteBuffer.limit() == 0) {
      return "";
    }
    byte[] buffer = new byte[byteBuffer.limit()];
    byteBuffer.get(buffer);
    return new String(buffer, charset);
  }
public static String byteBufferToString ( ByteBuffer byteBuffer , Charset charset ) { if ( byteBuffer == null ) { return null ; } if ( byteBuffer . limit ( ) == 0 ) { return "" ; } byte [ ] buffer = new byte [ byteBuffer . limit ( ) ] ; byteBuffer . get ( buffer ) ; return new String ( buffer , charset ) ; }
Used to transfer buffer data to {@link String}.
Used to transfer buffer data to { @link String } .