I/O teaching tool that generates sample Java source code to read or write the console, a sequential file, a random access file, a String, an array of characters, an array of bytes, URL, HTTP CGI GET/POST, Socket or Pipe. It shows you how to read or write ASCII-8 bit characters (plain or locale-encoded), Unicode 16-bit characters, raw bytes, big endian binary, Little endian binary, or serialised objects, buffered, unbuffered or gzip compressed.
FileIO runs either as an application or as an Applet that needs to run in JDK 1.5+ capable browser. Source code and sample HTML included. May be freely distributed and used for any
purpose except military.
It works by asking you 4 multiple choice questions about what you want to do. You fill in your
choices in a dialog Box at it instantly generates the corresponding code that you can copy/paste and modify.
1) What is the type of the source/target?
- sequential file
- random access file
- String (in RAM i/o)
- Char[] (in RAM i/o)
- byte[] (in RAM i/o)
- URL (remote i/o)
- HTTP CGI
- socket
- pipe
2) Do you want to read or write?
3) Which do you want: unbuffered, buffered or
compressed?
4) What is the format of the data being read or
written?
- raw, untranslated, bulk, 8-bit bytes
- Default-encoded chars (usually 8-bit)
- locale-encoded chars (usually 8-bit),
e.g. IBM-OEM Cp437
- Unicode 16-bit chars
- big-endian binary (Java standard)
- little-endian binary (Intel standard)
- serialised objects
It generates 378 possible different example programs.
You can run it online at http://mindprod.com/applet/fileio.html without
installing it.