mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
61 lines
1.0 KiB
XML
61 lines
1.0 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
<name>saveBytes()</name>
|
|
|
|
<category>Input/Output</category>
|
|
|
|
<subcategory>Files</subcategory>
|
|
|
|
<usage>Application</usage>
|
|
|
|
<example>
|
|
<image></image>
|
|
<code>
|
|
byte[] nums = { 0, 34, 5, 127, 52};
|
|
|
|
// now write the bytes to a file
|
|
saveBytes("numbers.txt", nums);
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Opposite of <b>loadBytes()</b>, will write an entire array of bytes to a file. This file is saved to the sketch's folder, which is opened by selecting "Show sketch folder" from the "Sketch" menu.
|
|
</description>
|
|
|
|
<syntax>
|
|
saveBytes(<c>filename</c>, <c>bytes</c>)
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>filename</label>
|
|
<description>name of file to write to</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>bytes</label>
|
|
<description>array of bytes to be written</description>
|
|
</parameter>
|
|
|
|
<returns>None</returns>
|
|
|
|
<related>
|
|
loadStrings()
|
|
loadBytes()
|
|
saveStrings()
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Function</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
<level>Extended</level>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</root>
|