1 /*************************************************************************
2 /* PrintStreamTest.java -- Test of the PrintStream class
4 /* Copyright (c) 1998 Free Software Foundation, Inc.
5 /* Written by Aaron M. Renn (arenn@urbanophile.com)
7 /* This program is free software; you can redistribute it and/or modify
8 /* it under the terms of the GNU General Public License as published
9 /* by the Free Software Foundation, either version 2 of the License, or
10 /* (at your option) any later version.
12 /* This program is distributed in the hope that it will be useful, but
13 /* WITHOUT ANY WARRANTY; without even the implied warranty of
14 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 /* GNU General Public License for more details.
17 /* You should have received a copy of the GNU General Public License
18 /* along with this program; if not, write to the Free Software Foundation
19 /* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 /*************************************************************************/
24 public class PrintStreamTest
27 public static void main(String
[] argv
) throws IOException
29 System
.out
.println("Started test of PrintStream");
30 System
.out
.println("Test 1: Printing Test");
32 char[] carray
= { 'h', 'i' };
33 byte[] barray
= { 'b', 'y', 'e' };
35 PrintStream ps
= new PrintStream(new FileOutputStream("printstream.out"));
45 ps
.print(0xFFFFFFFFFFL
);
49 ps
.print((double)99999999999.9999);
53 ps
.print("This is a string");
62 ps
.println(0xFFFFFFFFFFL
);
64 ps
.println((double)99999999999.9999);
66 ps
.println("This is a string");
70 ps
.write(barray
, 0, barray
.length
);
75 System
.out
.println("FAILED: Printing Test");
77 System
.out
.println("PASSED: Printing Test");
79 System
.out
.println("PASSED: Test of PrintStream");
82 } // class PrintStreamTest