List of utility methods to do Byte Create
byte | toByte(boolean value) to Byte return value ? (byte) 1 : (byte) 0; |
byte | toByte(boolean... values) to Byte if (values.length > Byte.SIZE) { throw new IllegalArgumentException("Expected less or equal to " + Byte.SIZE + " arguments"); byte b = 0; for (int i = 0; i < values.length; i++) { b |= values[i] ? POWERS[i] : 0; return b; ... |
byte | toByte(byte[] data) to Byte return (data == null || data.length == 0) ? 0x0 : data[0];
|
byte[] | toByte(byte[] src) Convert an array of byte 's into an array of byte '. return src;
|
byte | toByte(byte[] value) byte[] -> byte return (value == null || value.length == 0) ? 0x0 : value[0];
|
byte | toByte(char c) Convert char to byte return (byte) "0123456789ABCDEF".indexOf(c); |
int | toByte(char c) to Byte byte b = (byte) baseChar.indexOf(c); return b; |
byte | toByte(char c) to Byte byte b = (byte) "0123456789ABCDEF".indexOf(c); return b; |
int | toByte(char c) to Byte if (c >= '0' && c <= '9') return (c - '0'); if (c >= 'A' && c <= 'F') return (c - 'A' + 10); if (c >= 'a' && c <= 'f') return (c - 'a' + 10); throw new RuntimeException("Invalid hex char '" + c + "'"); |
byte | toByte(char hex) to Byte switch (hex) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': ... |