Java Char Create toCharString(byte[] bytes)

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

Description

to Char String

License

Open Source License

Declaration

public static String toCharString(byte[] bytes) 

Method Source Code

//package com.java2s;

public class Main {
    public static String toCharString(byte[] bytes) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < bytes.length; i++) {
            char c = (char) (bytes[i] & 0xFF);
            sb.append(c);/* w  w w.  j  a  v  a 2 s  . c  o  m*/
            sb.append(' ');
            if (i % 8 == 7) {
                sb.append('\n');
                sb.append(' ');
                sb.append(' ');
            }
        }
        return sb.toString();
    }
}

Related

  1. toChars(int number, char chars[])
  2. toChars(int[] src, int srcOff, int srcLen, char[] dest, int destOff)
  3. toChars(String from)
  4. toChars(String s)
  5. toCharSequence(final Object value)
  6. toCharWithoutOverflow(double value)