org.wings.io
Class OutputStreamDevice

java.lang.Object
  extended by org.wings.io.OutputStreamDevice
All Implemented Interfaces:
Device

public final class OutputStreamDevice
extends Object
implements Device

A Device encapsulating a ServletOutputStream

Author:
Holger Engels

Constructor Summary
OutputStreamDevice(OutputStream out)
           
 
Method Summary
 void close()
          close the Device.
 void flush()
          Flush this Stream.
 boolean isSizePreserving()
          returns, whether this the size of data put into this device is the same as comes out.
 Device print(char c)
          Print a character.
 Device print(char[] c)
          Print an array of chars.
 Device print(char[] c, int start, int len)
          Print a character array.
 Device print(int i)
          Print an integer.
 Device print(Object o)
          Print any Object
 Device print(String s)
          Print a String.
 Device write(byte[] b)
          Writes b.length bytes from the specified byte array to this output stream.
 Device write(byte[] b, int off, int len)
          Writes len bytes from the specified byte array starting at offset off to this output stream.
 Device write(int c)
          Writes the specified byte to this data output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStreamDevice

public OutputStreamDevice(OutputStream out)
Method Detail

isSizePreserving

public boolean isSizePreserving()
Description copied from interface: Device
returns, whether this the size of data put into this device is the same as comes out. This is necessary to know if we want to send the content size: if we know the content size, but this device changes the size, we must not send it.

Specified by:
isSizePreserving in interface Device
Returns:
'true', if this device leaves the size of the data going through it, untouched. This is usually true.

flush

public void flush()
           throws IOException
Flush this Stream.

Specified by:
flush in interface Device
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: Device
close the Device.

Specified by:
close in interface Device
Throws:
IOException

print

public Device print(String s)
             throws IOException
Print a String.

Specified by:
print in interface Device
Throws:
IOException

print

public Device print(int i)
             throws IOException
Print an integer.

Specified by:
print in interface Device
Throws:
IOException

print

public Device print(Object o)
             throws IOException
Print any Object

Specified by:
print in interface Device
Throws:
IOException

print

public Device print(char c)
             throws IOException
Print a character.

Specified by:
print in interface Device
Throws:
IOException

print

public Device print(char[] c)
             throws IOException
Print an array of chars.

Specified by:
print in interface Device
Throws:
IOException

print

public Device print(char[] c,
                    int start,
                    int len)
             throws IOException
Print a character array.

Specified by:
print in interface Device
Throws:
IOException

write

public Device write(int c)
             throws IOException
Writes the specified byte to this data output stream.

Specified by:
write in interface Device
Throws:
IOException

write

public Device write(byte[] b)
             throws IOException
Writes b.length bytes from the specified byte array to this output stream.

Specified by:
write in interface Device
Throws:
IOException

write

public Device write(byte[] b,
                    int off,
                    int len)
             throws IOException
Writes len bytes from the specified byte array starting at offset off to this output stream.

Specified by:
write in interface Device
Throws:
IOException


wingS Swings ;-)