Java ByteBuffer to String toString(ByteBuffer buffer)

Here you can find the source of toString(ByteBuffer buffer)

Description

to String

License

Open Source License

Declaration

public static String toString(ByteBuffer buffer) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static String toString(ByteBuffer buffer) {
        byte bytes[] = new byte[buffer.remaining()];
        buffer.get(bytes);//from  ww w . j av  a 2s  . c o m
        return new String(bytes);
    }
}

Related

  1. toString(@Nonnull ByteBuffer buf, int len)
  2. toString(ByteBuffer b, String separator)
  3. toString(ByteBuffer bb)
  4. toString(ByteBuffer buf)
  5. toString(ByteBuffer buf, int len)
  6. toString(ByteBuffer buffer)
  7. toString(ByteBuffer buffer)
  8. toString(ByteBuffer buffer)
  9. toString(ByteBuffer buffer)