org.wings.io
Class CountingDeviceDelegator

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

public final class CountingDeviceDelegator
extends Object
implements Device


Constructor Summary
CountingDeviceDelegator(Device d)
           
 
Method Summary
 void close()
          close the Device.
 void flush()
          Flush this Device.
 long getSize()
          returns the number of bytes written to this data sink.
 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 a character array.
 Device print(char[] c, int start, int len)
          Print len characters from the specified char array starting at offset off to this Device.
 Device print(int i)
          Print an integer.
 Device print(Object o)
          Print any Object
 Device print(String s)
          Print a String.
 void resetSize()
          reset the number of bytes to zero.
 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 Device.
 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

CountingDeviceDelegator

public CountingDeviceDelegator(Device d)
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 Device.

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

getSize

public long getSize()
returns the number of bytes written to this data sink.


resetSize

public void resetSize()
reset the number of bytes to zero.


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 a character array.

Specified by:
print in interface Device
Throws:
IOException

print

public Device print(char[] c,
                    int start,
                    int len)
             throws IOException
Print len characters from the specified char array starting at offset off to this Device.

Specified by:
print 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

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 Device.

Specified by:
write in interface Device
Throws:
IOException


wingS Swings ;-)