|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.n52.wps.io.binary.LargeBufferStream
public class LargeBufferStream
A fully buffered output stream using local disk storage for large data.
Initially this output stream buffers to memory, like ByteArrayOutputStream might do, but it shifts to using an on disk temporary file if the output gets too large.
The content of this buffered stream may be sent to another OutputStream only
after this stream has been properly closed by close()
.
Constructor Summary | |
---|---|
LargeBufferStream()
Create a new empty temporary buffer. |
Method Summary | |
---|---|
void |
close()
|
void |
destroy()
Clear this buffer so it has no data, and cannot be used again. |
long |
length()
Obtain the length (in bytes) of the buffer. |
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
void |
writeTo(java.io.OutputStream os)
Send this buffer to an output stream. |
Methods inherited from class java.io.OutputStream |
---|
flush, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LargeBufferStream()
Method Detail |
---|
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public long length()
The length is only accurate after close()
has been invoked.
public void writeTo(java.io.OutputStream os) throws java.io.IOException
This method may only be invoked after close()
has completed
normally, to ensure all data is completely transferred.
os
- stream to send this buffer's complete content to.pm
- if not null progress updates are sent here. Caller should
initialize the task and the number of work units to
length()
/1024
.
java.io.IOException
- an error occurred reading from a temporary file on the local
system, or writing to the output stream.public void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |