KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > neu > ccs > jmk > sun > OutputStreamToPrintWriter


1 // $Id: OutputStreamToPrintWriter.java,v 1.2 2001/12/07 11:41:24 ramsdell Exp $
2

3 /*
4 * Copyright 1998 by olivier Refalo
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */

20
21 package edu.neu.ccs.jmk.sun;
22
23 import java.io.*;
24
25 public final
26 class OutputStreamToPrintWriter
27 extends OutputStream
28 {
29
30     private PrintWriter pw_=null;
31
32     public OutputStreamToPrintWriter(PrintWriter _pw)
33     {
34         pw_=_pw;
35     }
36
37     public void write(int b)
38     throws IOException {
39         pw_.print((char)b);
40     }
41 }
42
Popular Tags