IO HowTo
General
Redirect output(stdout/stderr) to a frame
Redirect printStackTrace() to a String
Redirect to NULL device
Devices (printer, drives, ...)
Print text to a printer easily
Print without a Dialog
Initialize and write to a serial port
Open or close a CD/DVD drive
Get the volume label
Detect the storage device type
Console IO
Get faster console output (System.out.println() replacement)
Simple input from the keyboard
Output french character to the console
Clear the console and control attributes
Easy keyboard input (JDK1.5)
Force keyboard input in CAPS LOCK on
Execute an external program
Execute an external program and capture the output
Launch the application associated with a file extension
Launch an application from another application
Start the default browser from an application
Execute a Windows Shortcut (.lnk)
Create a file association with a Java program
Capture the output from a VBS
Get a return code from a VBS
Execute a CMD file stored in a JAR
File
Read the content of a file
Read a text file from a Jar
Extract a file from a Jar
Read a data file with floats
Write to the end of a file
Write "real" ascii file
Copy a file
Use a "log file"
Delete files with a certain extension
Insert a line in a file
Read a file into a variable in one shot
Serialize an object to a file
Redirect stdout to a file
Get the "last modified" date from a file
Check if a file exists
Detect file (or folder) modification
File/directory polling to detect change
Get the current directory
Get the "root" of an application
Get the content of a directory with a Filter
Get the content of a directory with subdirectories
Make a directory
Create a fixed-length file
Delete a non-empty directory
Create a temporary file
Get the default character set of the JVM
Parse a pathname
Handle Excel files
Handle CSV files
Create an Excel file (the easy way)
Convert OEM (DOS) file to Ansi (Windows)
Close a stream in a try/catch block
Rename a file extension
Remove HTML tags from a file to extract only the TEXT
Get the Mime Type from a File
Sort a directory listing (based on the last modified timestamp)
Sort files by the extension
Filter a directory listing by date
Convert wildcard to a regex expression
Shorten a long path
Force a valid Windows filename
Dump a file to a HEX file
List all files in the classpath or in a Jar
PDF
Create or process PDF files
iText - Create a PDF
Split a PDF file (using iText)
Concatenate PDF files (using iText)
Convert TIF to PDF
Print a PDF
ZIP
Create a compressed (ZIP) file
Display compressed (ZIP) file content
Expand the compressed (ZIP) file
Audio
Emit a beep
Emit a tone
Play an audio file from an application
Produce special sound effect
Use the Java Speech API (JSPAPI)
IO HowTo
If you find this article useful, consider making a small donation
to show your support for this Web site and its content.
Written and compiled by Réal Gagnon ©1998-2010
[
home
]