src/share/classes/java/lang/Byte.java
Print this page
rev 6091 : 7088952: Add size in bytes constant "BYTES" to primitive type wrapper types
Summary: Adds a constant BYTES to each of the primitive wrapper classes (Byte, Character, Double, Float, Integer, Long, Short) with the calculation Primitive.SIZE / Byte.SIZE already made.
Reviewed-by: smarks, darcy
*** 492,499 ****
--- 492,507 ----
*
* @since 1.5
*/
public static final int SIZE = 8;
+ /**
+ * The number of bytes used to represent a {@code byte} value in two's
+ * complement binary form.
+ *
+ * @since 1.8
+ */
+ public static final int BYTES = SIZE / Byte.SIZE;
+
/** use serialVersionUID from JDK 1.1. for interoperability */
private static final long serialVersionUID = -7183698231559129828L;
}