GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • Download
  • Reference
  • Environment
  • Libraries
  • Tools
  • Wiki
  • Tutorials
  • Examples
  • Books
  • Forum
  • Overview
  • People
  • Privacy

This view

  • Original page
  • New address

GeezerVison is showing processing.org — saveBytes() / Reference

Reference+
Documentation→Reference→Output→Files

Name

saveBytes()

Description

As the opposite of loadBytes(), this function will write an entire array of bytes to a file. The data is saved in binary format. This file is saved to the sketch's folder, which is opened by selecting "Show Sketch Folder" from the "Sketch" menu. Alternatively, the files can be saved to any location on the computer by using an absolute path (something that starts with / on Unix and Linux, or a drive letter on Windows).

Examples

  • byte[] nums = { 0, 34, 5, 127, 52};
    
    // Writes the bytes to a file
    saveBytes("numbers.dat", nums);
    

Syntax

  • saveBytes(filename, data)

Parameters

  • filename(String)name of the file to write to
  • data(byte[])array of bytes to be written

Return

  • void

Related

  • loadStrings()
  • loadBytes()
  • saveStrings()
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.