Java ByteBuffer to String buffer2String(ByteBuffer buff, String charsetName)

Here you can find the source of buffer2String(ByteBuffer buff, String charsetName)

Description

buffer String

License

Apache License

Declaration

public static String buffer2String(ByteBuffer buff, String charsetName) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;
import java.nio.charset.Charset;

public class Main {
    public static String buffer2String(ByteBuffer buff, String charsetName) {
        return Charset.forName(charsetName).decode(buff).toString();
    }/*from w  w  w .ja  v  a2  s .c om*/
}

Related

  1. asStr(ByteBuffer buff)
  2. asString(ByteBuffer buffer, int length)
  3. asString(final ByteBuffer buffer)
  4. asString(Map headers)
  5. bbToString(ByteBuffer bb)
  6. bufferToString(ByteBuffer buf)
  7. bufferToString(ByteBuffer buf)
  8. bufferToString(ByteBuffer buff)
  9. bufferToString(ByteBuffer buffer)