|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream ccs.utils.SwappingBuffer ccs.utils.RepeatingSwappingBuffer
public class RepeatingSwappingBuffer
A SwappingBuffer which, once filled, can be written multiple times. The
drawback is that you must call cleanup
after
all writes have completed. A try..finally
construct is recommended.
Failure to do this may result in a security breach. MT-UNSAFE.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ccs.utils.SwappingBuffer |
---|
SwappingBuffer.DestructiveBAIS, SwappingBuffer.PeekableBAOS |
Field Summary |
---|
Fields inherited from class ccs.utils.SwappingBuffer |
---|
baos, cipher, cos, DEAD, DEFAULTSWAP, f, isFile, mimeType, phase, READCOMMITTED, UNWRITABLE, wad, WRITABLE |
Constructor Summary | |
---|---|
RepeatingSwappingBuffer()
Creates a new RepeatingSwappingBuffer with a default threshold (512K) and default auto-destruct. |
|
RepeatingSwappingBuffer(byte[] contents)
Creates a new "pre-filled" SwappingBuffer whose contents are the supplied buffer. |
|
RepeatingSwappingBuffer(int threshold)
Creates a new SwappingBuffer with the supplied threshold and default auto-destruct. |
|
RepeatingSwappingBuffer(int threshold,
int autoDestruct)
Creates a new SwappingBuffer with the supplied threshold and auto-destruct level. |
Method Summary | |
---|---|
void |
cleanup()
Cleans up after all writes have been completed. |
java.io.InputStream |
getInputStream()
Returns a buffered input stream which reads from this buffer. |
void |
writeTo(java.io.OutputStream os)
Writes the contents of the buffer to the supplied stream. |
Methods inherited from class ccs.utils.SwappingBuffer |
---|
close, finalize, flush, getByteArray, getFile, getFilePath, getLifecycleStage, isWritable, randomRead, size, write, write |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RepeatingSwappingBuffer()
public RepeatingSwappingBuffer(int threshold)
public RepeatingSwappingBuffer(int threshold, int autoDestruct)
threshold
- The threshold at which to swap to disk.autoDestruct
- The auto-destruct level for disk files; a constant from
FileKiller
.public RepeatingSwappingBuffer(byte[] contents)
Method Detail |
---|
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class SwappingBuffer
java.io.IOException
- if there is a problem during the process.public void writeTo(java.io.OutputStream os) throws java.io.IOException
writeTo
in class SwappingBuffer
os
- The stream to write to.
java.io.IOException
- if the call failed.public void cleanup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |