List of utility methods to do Byte Array to String Convert
String | base16(byte[] data) base return byteArray2HexString(data);
|
List | ByteArrayToStringList(byte[] byteArray, int dataLength) Converts a byte array into a String array if (byteArray == null) { return null; if (dataLength <= 0) { return null; if (dataLength > byteArray.length) { return null; ... |
String | toStringForm(byte[] arr) to String Form StringBuilder sb = new StringBuilder(); for (byte b : arr) { sb.append(((int) b) + ""); return sb.toString(); |
String | toStringUntil(byte[] b, int pos, byte until) to String Until StringBuilder str = new StringBuilder(); while (true) { if (b.length <= pos) { return null; byte ch = b[pos]; if (ch == until) { break; ... |
String | toStringWithLength(byte[] b, int pos, int length) to String With Length StringBuilder str = new StringBuilder(); for (int i = 0; i < length; i++) { str.append((char) b[pos + i]); String ret = str.toString(); return ret; |
void | printBytes(byte[] bytes, StringBuilder builder, int bytesPerLine) print Bytes for (int i = 0; i < bytes.length; i++) { if (i != 0 && i % bytesPerLine == 0) { builder.append("\n"); builder.append(String.format("%02x ", bytes[i])); |
String | printBytes(byte[] bytes, int bytesPerLine) print Bytes StringBuilder builder = new StringBuilder(); printBytes(bytes, builder, bytesPerLine); return builder.toString(); |
void | printBytes(byte[] data, String type) print Bytes if (type == null) { type = ""; System.out.println(); System.out.println(bytes2StringPtr(data, type)); System.out.println(); |
ByteString | bytesToByteString(byte[] bytes) bytes To Byte String return ByteString.copyFrom(bytes);
|
String | toText(byte[] arr) To text? String ret = ""; if (arr != null && arr.length > 0) { for (int i = 0; i < arr.length; i++) { if (i > 0) { ret += "."; int b = toUnsignedInteger(arr[i]); ret += b; ... |