org.tinygroup.weblayer.webcontext.parser.fileupload
| Constructor and 描述 |
|---|
DeferredByteOutputStream(int threshold)
Constructs an instance of this class which will trigger an event at the
specified threshold, and save data to a file beyond that point.
|
| Modifier and Type | Method and 描述 |
|---|---|
void |
clearData() |
void |
close()
Closes underlying output stream, and mark this as closed
|
byte[] |
getFileData()
返回文件字节流
|
byte[] |
getMemoryData()
Returns the data for this output stream as an array of bytes, assuming
that the data has been retained in memory.
|
protected OutputStream |
getStream()
Returns the current output stream.
|
boolean |
isInMemory()
Determines whether or not the data for this output stream has been
retained in memory.
|
protected void |
thresholdReached()
Switches the underlying output stream from a memory based stream to one
that is backed by disk.
|
void |
writeTo(OutputStream out)
Writes the data from this output stream to the specified output stream,
after it has been closed.
|
public DeferredByteOutputStream(int threshold)
threshold - The number of bytes at which to trigger an event.outputFile - The file to which data is saved beyond the threshold.protected OutputStream getStream() throws IOException
getStream 类 {1} 中的 {0} org.apache.commons.io.output.ThresholdingOutputStreamIOException - if an error occurs.protected void thresholdReached()
throws IOException
thresholdReached 类 {1} 中的 {0} org.apache.commons.io.output.ThresholdingOutputStreamIOException - if an error occurs.public boolean isInMemory()
true if the data is available in memory; false
otherwise.public byte[] getMemoryData()
null.null if no such data
is available.public byte[] getFileData()
public void close()
throws IOException
close 接口 {1} 中的 {0} Closeableclose 类 {1} 中的 {0} org.apache.commons.io.output.ThresholdingOutputStreamIOException - if an error occurs.public void writeTo(OutputStream out) throws IOException
out - output stream to write to.IOException - if this stream is not yet closed or an error occurs.public void clearData()
Copyright © 2006–2015 TinyGroup. All rights reserved.