#N canvas 237 152 1080 699 12;
#X msg 103 98 rewind;
#X obj 267 577 textfile;
#X msg 80 75 bang;
#X msg 179 174 clear;
#X msg 282 277 set 2 4 6 8;
#X obj 181 -89 binfile;
#X text 246 -90 read and write binary files;
#X msg 202 197 add 10 20 255;
#X obj 410 425 binfile;
#X text 344 576 to read and write text files;
#X msg 305 300 write afile.bin;
#X text 534 449 This outlet gives a bang when you hit the end of the
sequence.;
#X text 481 539 This outlet gives the bytes in sequence \, or bangs
if no more bytes.;
#X text 370 275 clear the buffer and then add some bytes;
#X text 224 173 empty the buffer;
#X text 155 98 set the read pointer to the beginnning of the buffer
;
#X text 119 75 output one byte from the buffer as a float;
#X text 422 298 write the entire buffer to a file;
#X obj 410 545 print one;
#X obj 35 60 bng 15 250 50 0 empty empty empty 17 7 0 10 -4034 -257985
-1;
#X text 266 559 See also:;
#X obj 57 -13 openpanel;
#X obj 57 -37 bng 15 250 50 0 empty empty read_any_file_into_buffer
17 7 0 10 -4032 -258113 -1;
#X msg 57 52 read \$1;
#X obj 39 354 bng 15 250 50 0 empty empty save_buffer_as_any_file 17
7 0 10 -4032 -258113 -1;
#X msg 397 392 write \$1;
#X obj 400 369 savepanel;
#X msg 237 232 77 128 129 130;
#X text 254 -50 The binfile object reads and writes binary files to
and from a buffer in memory. You can read a file and output its contents
one byte at a time as floats.;
#X text 442 46 To add bytes to the buffer \, first send "clear" to
empty the buffer and then "add" to add bytes. Finally \, "write" will
save the entire buffer as a binary file.;
#X floatatom 259 255 5 0 0 0 - - -;
#X text 299 253 add one byte \, same as "add";
#X text 349 231 add a list of bytes \, same as "add";
#X msg 15 10 info;
#X obj 433 515 print info;
#X obj 466 455 print end;
#X msg 328 323 readat 3;
#X msg 351 346 writeat 3;
#X text 425 346 set the write position;
#X text 395 323 set the read position;
#X text 512 509 This outlet gives a list of current parameters from
the info message.;
#X text 303 197 add a list of byte-floats to the buffer at the current
write offset;
#X text 65 10 output current buffer length and pointer values through
the middle outlet.;
#X text 233 121 read a file into the buffer and make it the new buffer
;
#X obj 456 493 tgl 15 0 empty empty empty 17 7 0 10 -258113 -257985
-1 0 1;
#N canvas 507 310 494 344 META 0;
#X text 12 175 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 25 LICENSE GPL v2 or later;
#X text 12 5 KEYWORDS control filesystem;
#X text 12 45 DESCRIPTION read and write binary files;
#X text 12 65 INLET_0 float bang list info read rewind clear add set
write readat writeat symbol;
#X text 12 95 OUTLET_0 float bang;
#X text 12 115 OUTLET_1 list;
#X text 12 135 OUTLET_2 bang;
#X text 12 155 AUTHOR Martin Peach;
#X restore 882 607 pd META;
#X text 525 363 You can also use this object simply for storing heterogeneous
sequences of bytes.;
#X text 481 404 Optional arguments for filename and length to be read
(same as [read( message;
#X msg 151 146 read test.txt 5;
#X msg 126 121 read test.txt;
#X text 267 145 read the first 5 bytes of a file into the buffer;
#X text 760 580 Martin Peach 2014/01/27;
#X connect 0 0 8 0;
#X connect 2 0 8 0;
#X connect 3 0 8 0;
#X connect 4 0 8 0;
#X connect 7 0 8 0;
#X connect 8 0 18 0;
#X connect 8 1 34 0;
#X connect 8 2 35 0;
#X connect 8 2 44 0;
#X connect 10 0 8 0;
#X connect 19 0 2 0;
#X connect 21 0 23 0;
#X connect 22 0 21 0;
#X connect 23 0 8 0;
#X connect 24 0 26 0;
#X connect 25 0 8 0;
#X connect 26 0 25 0;
#X connect 27 0 8 0;
#X connect 30 0 8 0;
#X connect 33 0 8 0;
#X connect 36 0 8 0;
#X connect 37 0 8 0;
#X connect 48 0 8 0;
#X connect 49 0 8 0;
