This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name

byte()

Examples
char c = 'E';
byte b = byte(c);
println(c + " : " + b);  // Prints "E : 69"

int i = 130;
b = byte(i);
println(i + " : " + b);  // Prints "130 : -126"
Description Converts a primitive datatype or array to its byte representation. A byte can only be a whole number between -128 and 127, therefore when a number outside this range is converted, its value wraps to the corresponding byte representation.
Updated on May 19, 2014 05:30:05pm PDT

Creative Commons License