Java Byte Array to String bytesToString(byte[] data)

Here you can find the source of bytesToString(byte[] data)

Description

bytes To String

License

Open Source License

Declaration

private static String bytesToString(byte[] data) 

Method Source Code

//package com.java2s;

public class Main {
    private static String bytesToString(byte[] data) {
        char[] cs = new char[data.length];

        for (int i = 0; i != cs.length; i++) {
            cs[i] = (char) (data[i] & 0xff);
        }/* w  w  w . j  a  va 2  s .  c  o  m*/

        return new String(cs);
    }
}

Related

  1. bytesToString(byte[] bytes)
  2. bytesToString(byte[] bytes)
  3. bytesToString(byte[] bytes, int offs, int len)
  4. bytesToString(byte[] bytes, int startIndex)
  5. bytesToString(byte[] bytes, String encoding)
  6. bytesToString(byte[] data, int start, int end)
  7. bytesToString(byte[] hasher)
  8. bytesToString(byte[] id)
  9. bytesToString(byte[] input)