Java Byte Array to String asString(byte[] buf)

Here you can find the source of asString(byte[] buf)

Description

as String

License

Open Source License

Declaration

private static String asString(byte[] buf) 

Method Source Code

//package com.java2s;

public class Main {
    private static String asString(byte[] buf) {
        StringBuffer strbuf = new StringBuffer(buf.length);
        for (int i = 0; i < buf.length; i++) {
            strbuf.append((char) buf[i]);
        }/*from   w ww .j a v a 2 s.c  o  m*/
        return strbuf.toString();
    }
}

Related

  1. arr2String(byte[] arr, int start)
  2. ASCIIByteArrayToString(byte[] data)
  3. asString(byte[] a, String separator)
  4. asString(byte[] array)
  5. asString(byte[] bs)
  6. asString(byte[] bytes)
  7. asString(byte[] bytes)
  8. ByteArrayToString(byte[] byteArray)
  9. bytes2str(byte[] arr)