org.jasig.portal.serialize
Class CachingOutputStream
java.lang.Object
java.io.OutputStream
org.jasig.portal.serialize.CachingOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, CharacterCachingWriter
public class CachingOutputStream
- extends java.io.OutputStream
- implements CharacterCachingWriter
Field Summary |
(package private) java.io.ByteArrayOutputStream |
cache
|
(package private) boolean |
caching
|
(package private) java.io.OutputStream |
out
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
java.io.OutputStream out
cache
java.io.ByteArrayOutputStream cache
caching
boolean caching
CachingOutputStream
public CachingOutputStream(java.io.OutputStream out)
startCaching
public boolean startCaching()
throws java.io.IOException
- Specified by:
startCaching
in interface CharacterCachingWriter
- Throws:
java.io.IOException
getCache
public java.lang.String getCache(java.lang.String encoding)
throws java.io.UnsupportedEncodingException,
java.io.IOException
- Specified by:
getCache
in interface CharacterCachingWriter
- Throws:
java.io.UnsupportedEncodingException
java.io.IOException
stopCaching
public boolean stopCaching()
- Specified by:
stopCaching
in interface CharacterCachingWriter
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush
in interface java.io.Flushable
- Specified by:
flush
in interface CharacterCachingWriter
- Overrides:
flush
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(int b)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
- Throws:
java.io.IOException