KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > io > DeviceOutputStream


1 /*
2  * $Id: DeviceOutputStream.java,v 1.3 2004/12/01 07:54:08 hengels Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.io;
15
16 import java.io.IOException JavaDoc;
17 import java.io.OutputStream JavaDoc;
18
19 /**
20  * An OutputStream, that writes to an Device.
21  *
22  * @author <a HREF="mailto:H.Zeller@acm.org">Henner Zeller</a>
23  * @version $Revision: 1.3 $
24  */

25 public final class DeviceOutputStream extends OutputStream JavaDoc {
26     final Device sink;
27
28     public DeviceOutputStream(Device d) {
29         sink = d;
30     }
31
32     public void close() {}
33
34     public void flush() throws IOException JavaDoc {
35         sink.flush();
36     }
37
38     public void write(byte b[],
39                       int off,
40                       int len) throws IOException JavaDoc {
41         sink.write(b, off, len);
42     }
43
44     public void write(byte b[]) throws IOException JavaDoc {
45         sink.write(b);
46     }
47
48     public void write(int b) throws IOException JavaDoc {
49         sink.write(b);
50     }
51 }
52
53
54
Popular Tags