Java Byte Array Create toBytesString(byte[] bytes)

Here you can find the source of toBytesString(byte[] bytes)

Description

to Bytes String

License

Apache License

Declaration

public static String toBytesString(byte[] bytes) 

Method Source Code

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

public class Main {
    public static String toBytesString(byte[] bytes) {
        if (bytes == null) {
            return null;
        }/*from  ww  w  .ja  v  a 2s .c o m*/
        StringBuilder buffer = new StringBuilder(256);
        for (byte b : bytes) {
            buffer.append((char) b);
        }
        return buffer.toString();
    }
}

Related

  1. toBytesHexEscaped(final byte[] s, final int off, final int len)
  2. toBytesInt32BE(int w)
  3. toBytesLittleEndian(long value, int cnt)
  4. toBytesOctalEscaped(final byte[] s, final int off, final int len)
  5. toBytesShortBE(short w)
  6. toByteString(byte[] bytes, String seperator)
  7. toByteString(byte[] content, int len)
  8. toByteString(final byte[] b)
  9. toByteString(final String source)