Basic HTML version of Foils prepared Sept 21 1998

Foil 32 FilterOutputStreams

From Java Tutorial 98- 4: Multi-Treading, Useful Java Classes, I/O and Networking NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken

FilterOutputStream classes for Foil 32
DataOutputStream and BufferedOutputStream are two important FilterOutputStreams.
To open a data stream to an output file, use:
  • DataOutputStream out =
  • new DataOutputStream (
  • new FileOutputStream( filename ) );
where filename is a filename string.
Note that DataOutputStream has methods to write any primitive type.
  • To open a buffered output stream, use:
  • BufferedOutputStream out =
  • new BufferedOutputStream (
  • new FileOutputStream( filename ) );
Only bytes may be written to a BufferedOutputStream.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998