Java ByteBuffer to String toString(ByteBuffer bb)

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

Description

to String

License

LGPL

Declaration

public static String toString(ByteBuffer bb) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static String toString(ByteBuffer bb) {
        StringBuilder sb = new StringBuilder();
        while (bb.hasRemaining()) {
            sb.append((char) bb.get());
        }/*ww  w.  j a v a2  s .  com*/
        return sb.toString();
    }
}

Related

  1. string(ByteBuffer buffer)
  2. string(ByteBuffer buffer, int position, int length, Charset charset)
  3. string(ByteBuffer bytes)
  4. toString(@Nonnull ByteBuffer buf, int len)
  5. toString(ByteBuffer b, String separator)
  6. toString(ByteBuffer buf)
  7. toString(ByteBuffer buf, int len)
  8. toString(ByteBuffer buffer)
  9. toString(ByteBuffer buffer)