Byte

The {@code Byte} class wraps a value of primitive type {@code byte} in an object. An object of type {@code Byte} contains a single field whose type is {@code byte}.

<p>In addition, this class provides several methods for converting a {@code byte} to a {@code string} and a {@code string} to a {@code byte}, as well as other constants and methods useful when dealing with a {@code byte}.

@author Nakul Saraiya @author Joseph D. Darcy @see java.lang.Number

Constructors

this
this(byte value)

Constructs a newly allocated {@code Byte} object that represents the specified {@code byte} value.

this
this(int value)
Undocumented in source.

Members

Functions

toHash
size_t toHash()

Returns a hash code for a {@code byte} value; compatible with {@code Byte.hashCode()}.

Static functions

parseByte
byte parseByte(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
toUnsignedInt
int toUnsignedInt(byte x)

Converts the argument to an {@code int} by an unsigned conversion. In an unsigned conversion to an {@code int}, the high-order 24 bits of the {@code int} are zero and the low-order 8 bits are equal to the bits of the {@code byte} argument.

toUnsignedLong
long toUnsignedLong(byte x)

Converts the argument to a {@code long} by an unsigned conversion. In an unsigned conversion to a {@code long}, the high-order 56 bits of the {@code long} are zero and the low-order 8 bits are equal to the bits of the {@code byte} argument.

Static variables

MAX_VALUE
byte MAX_VALUE;

A constant holding the maximum value a {@code byte} can have, 2<sup>7</sup>-1.

MIN_VALUE
byte MIN_VALUE;

A constant holding the minimum value a {@code byte} can have, -2<sup>7</sup>.

Variables

BYTES
enum int BYTES;

The number of bytes used to represent a {@code byte} value in two's complement binary form.

SIZE
enum int SIZE;

The number of bits used to represent a {@code byte} value in two's complement binary form.

Meta