-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathbyteconvert.xml
More file actions
executable file
·28 lines (22 loc) · 949 Bytes
/
byteconvert.xml
File metadata and controls
executable file
·28 lines (22 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>byte()</name>
<category>Data</category>
<subcategory>Conversion</subcategory>
<example>
<image></image>
<code><![CDATA[
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"
]]></code>
</example>
<description><![CDATA[
Converts any value of a primitive data type (<b>boolean</b>, <b>byte</b>, <b>char</b>, <b>color</b>, <b>double</b>, <b>float</b>, <b>int</b>, or <b>long</b>) to its byte representation. A byte can only be a whole number between <b>-128</b> and <b>127</b>, so when a value outside of this range is converted, it wraps around to the corresponding byte representation. (For example, <b>byte(128)</b> evaluates to <b>-128</b>.)<br />
<br />
When an array of values is passed in, then a <b>byte</b> array of the same length is returned.
]]></description>
</root>