Java Utililty Methods Byte to String

List of utility methods to do Byte to String

Description

The list of methods to do Byte to String are organized into topic(s).

Method

StringByteToString(int b)
converts the 8 lsb of the given integer to a String
return Integer.toBinaryString((b & 0xff) | 0x100).substring(1);
StringbyteToString(int n)
Returns a string of 2 hexadecimal digits (most significant digit first) corresponding to the lowest 8 bits of n.
char[] buf = { hexDigits[(n >>> 4) & 0x0F], hexDigits[n & 0x0F] };
return new String(buf);
StringbyteToString(int n)

Returns a string of 2 hexadecimal digits (most significant digit first) corresponding to the lowest 8 bits of n.

char[] buf = { HEX_DIGITS[(n >>> 4) & 0x0F], HEX_DIGITS[n & 0x0F] };
return new String(buf);
StringbyteToString(int val)
8-bit signed value to prefixed decimal conversion.
return ((val < 0x80) ? "+" : "") + Byte.toString((byte) val);