CMP File I/O Amanuensis 4.6. I/O teaching tool. The File I/O Amanuensis 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. The code it generates is a bit odd in that I field every exception exactly where it occurs, mainly to document precisely what throws what. In real life you would collapse the myriad separate try blocks into bigger ones. FileIO runs either as an application or as an applet that needs to run in JDK 1.1+ 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. This Applet does not yet give you any help with the Java 1.4 javax.imageio.ImageIO class or the java.nio classes: Buffer, ByteBuffer, ByteOrder, CharBuffer, DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer, MappedByteBuffer or ShortBuffer. Version 4.3 notes the missing readLine method in unbuffered Readers. Version 4.4 is simplified. It no longer shown the Exception catching. This makes for more realistic code that is easier to cut and paste. Version 4.5 shows you how to do GET/POST and HEAD and how to turn off keep-alive for more efficient HTTP transactions. Version 4.6 adds an about box, version checking, a warning about read not always giving all you ask for, and cleaner internals.