Java ByteBuffer Get getUTF8FromByteBuffer(ByteBuffer bb)

Here you can find the source of getUTF8FromByteBuffer(ByteBuffer bb)

Description

get UTF From Byte Buffer

License

Open Source License

Declaration

public static String getUTF8FromByteBuffer(ByteBuffer bb) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.*;
import java.nio.charset.*;

public class Main {
    public static String getUTF8FromByteBuffer(ByteBuffer bb) {
        Charset charset = Charset.forName("UTF-8");
        CharsetDecoder decoder = charset.newDecoder();
        try {//from  w w  w . j a  v a 2 s .  co m
            return decoder.decode(bb).toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getTsStartSyncByte(ByteBuffer packet, boolean synced)
  2. getTsSyncByte(ByteBuffer packet)
  3. getUByte(ByteBuffer b)
  4. getUleb128(ByteBuffer buffer)
  5. getUsedBytes(ByteBuffer bb)
  6. getUUID(ByteBuffer bytes)
  7. getVariance(ByteBuffer simulationResults)
  8. getVInt(ByteBuffer bf, int index)
  9. getWithShortLength(ByteBuffer bb)