Files, File Reading, File Writing Flashcards
where do computers store files
secondary devices eg hard disk, flash drives, DVDs etc
what is a byte-based stream
when input and output is in binary format
how many bytes in a characer
2
how many bytes in an int
4
how many bytes in a double
8
what is character based stream
output and input is a sequence of characters
example of character based stream
ASCII
Unicode
when would binary storage be used
images, videos
example of byte based file extensions
.jpeg
.png
example of character based file extensions
.txt
3 java input/output streams directly attached to console
system. in
system. out
system. err
can system.err be redirected? why might you want this?
yes
eg send to manufactures so they can debug and fix the problem
void write (byte[] arr) method in javaFileOutput stream does what
writes arr.length bytes from the bytes array to the output stream
how to write specific amounts from byte array
void write(byte[] array, int offset, int length)
how to write an individual byte in the array
voif write(int b)