Basic HTML version of Foils prepared 17 Nov 97

Foil 31 FilterOutputStreams

From Java Tutorial, July 1, 1996 CEWES Tutorial, CPS606, JSU Class CSC499 -- July 22-25 1997, Fall 97. by Nancy J. McCracken,Geoffrey C. Fox, Tom Scavo

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

in Table To:


© 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 Wed Apr 1 1998