src/share/classes/java/lang/Character.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

*** 7156,7165 **** --- 7156,7173 ---- * @since 1.5 */ public static final int SIZE = 16; /** + * The number of bytes used to represent a {@code char} value in unsigned + * binary form. + * + * @since 1.8 + */ + public static final int BYTES = SIZE / Byte.SIZE; + + /** * Returns the value obtained by reversing the order of the bytes in the * specified <tt>char</tt> value. * * @return the value obtained by reversing (or, equivalently, swapping) * the bytes in the specified <tt>char</tt> value.