I/O : Java Glossary
home I words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
I/O
Java has a bewildering array of I/O (input/output) routines. Many you can cascade together like Lego blocks to create variants. Have a look at this essay on JDK 1.0.2 candidate methods or this essay on JDK 1.1 candidate methods for the task at hand. The JDK 1.1 essay also shows suggested classes to use when upgrading deprecated JDK 1.0.2 methods.
I have also written an amanuensis Applet in Java, available with source code, to automatically generate Java source code for various combinations of file type and data type. You can just experiment to learn from complete examples, or you can cut and paste the code into your own applications.
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. You can use them buffered, unbuffered or GZIP compressed. Java works with seven types of data in your files:
  1. 7 or 8-bit ASCII characters (plain or locale-encoded)
  2. UTF 8-bit Unicode compressed character encoding.
  3. 16-bit Unicode characters
  4. Java binary format — platform independent big-endian binary representations. Have a look at this essay to see how DataOutputStream formats each of the primitive data types.
  5. Little-endian binary format.
  6. raw bytes
  7. persistent serialised objects
Java is missing basic input routines. You have to roll your own with java.util.StringTokenizer, java.io.StreamTokenizer or readLine to split the input up into strings, then use various conversion methods to convert to float, int etc.


CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.17] The information on this page is for non-military use only.
You are visitor number 12,261. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/io.html J:\mindprod\jgloss\io.html