Java Utililty Methods Byte Create

List of utility methods to do Byte Create

Description

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

Method

bytetoByte(long l)
to Byte
if (l < Byte.MIN_VALUE || l > Byte.MAX_VALUE)
    throw new ArithmeticException("Value (" + l + ") cannot fit into byte");
return (byte) l;
voidtoByte(long l, byte[] b, int off, boolean bigEndian)
to Byte
if (bigEndian) {
    b[off + 7] = (byte) (l & 0xff);
    b[off + 6] = (byte) ((l >> 8) & 0xff);
    b[off + 5] = (byte) ((l >> 16) & 0xff);
    b[off + 4] = (byte) ((l >> 24) & 0xff);
    b[off + 3] = (byte) ((l >> 32) & 0xff);
    b[off + 2] = (byte) ((l >> 40) & 0xff);
    b[off + 1] = (byte) ((l >> 48) & 0xff);
...
BytetoByte(Number num)
Convert the given number into a Byte instance.
return (num == null) ? null : Byte.valueOf(num.byteValue());
BytetoByte(Object o)
to Byte
if (o == null)
    return null;
if (o.getClass() == Byte.class)
    return (Byte) o;
if (o.getClass() == Boolean.class)
    return booleanToByte((Boolean) o);
if (o.getClass() == Character.class)
    return charToByte((Character) o);
...
BytetoByte(Object ob, Byte defaultByte)
to Byte
if (ob == null) {
    return defaultByte;
if (ob instanceof Integer) {
    return ((Integer) ob).byteValue();
} else if (ob instanceof Float) {
    return ((Float) ob).byteValue();
} else if (ob instanceof Double) {
...
bytetoByte(Object obj)
to Byte
return toByte(obj, (byte) 0);
BytetoByte(Object obj)
to Byte
return obj == null ? null : obj instanceof Byte ? (Byte) obj : newByte(obj);
bytetoByte(Object obj)
Get the byte value of this object, only if the object is an instance of Number
return (obj instanceof Number) ? ((Number) obj).byteValue() : 0;
bytetoByte(Object obj)
Convert object returned from server to byte.
return (byte) toLong(obj);
longtoByte(Object value)
to Byte
return (value == null || "null".equals(value.toString())) ? 0 : Byte.parseByte(value.toString().trim());