|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
java.lang.Objectjava.io.OutputStream
org.apache.commons.fileupload.ThresholdingOutputStream
org.apache.commons.fileupload.DeferredFileOutputStream
指定された閾値に達するまではデータをメモリ上に保持し、 閾値に達した場合にはディスク上に出力する出力ストリームです。 もし閾値に達することなくクローズされた場合には、データはディスクに全く書き込まれません。
| フィールドの概要 | |
private OutputStream |
currentOutputStream
現在データの出力先となっている出力ストリーム。 |
private FileOutputStream |
diskOutputStream
閾値に達した後にデータが書き込まれる出力ストリーム。 |
private ByteArrayOutputStream |
memoryOutputStream
閾値に達するまでデータが書き込まれる出力ストリーム。 |
private File |
outputFile
閾値を超えた場合に出力先となるファイル。 |
| クラス org.apache.commons.fileupload.ThresholdingOutputStream から継承したフィールド |
|
| コンストラクタの概要 | |
DeferredFileOutputStream(int threshold,
File outputFile)
イベントのトリガーとなる閾値の値と、それを超えた場合にデータをセーブするファイルを指定して クラスのインスタンスを生成します。 |
|
| メソッドの概要 | |
byte[] |
getData()
データがメモリ上にある場合、出力ストリームをバイトの配列にして返します。 |
File |
getFile()
データがディスク上にある場合、出力ストリームを File にして返します。
|
protected OutputStream |
getStream()
現在使われている出力ストリームを返します。 |
boolean |
isInMemory()
出力ストリームがメモリを対象にしているかを判断します。 |
protected void |
thresholdReached()
現在使用している出力ストリームをメモリを対象にしているものからディスクを対象にするものに切り替えます。 |
| クラス org.apache.commons.fileupload.ThresholdingOutputStream から継承したメソッド |
checkThreshold, close, flush, getByteCount, getThreshold, isThresholdExceeded, write, write, write |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
private ByteArrayOutputStream memoryOutputStream
private FileOutputStream diskOutputStream
private OutputStream currentOutputStream
memoryOutputStream か diskOutputStream
のどちらかとなります。
memoryOutputStream or
diskOutputStream.
private File outputFile
| コンストラクタの詳細 |
public DeferredFileOutputStream(int threshold,
File outputFile)
threshold - イベントのトリガーとなるバイトの値。
outputFile - 閾値を超えた場合にデータを保存するファイル。
| メソッドの詳細 |
protected OutputStream getStream()
throws IOException
ThresholdingOutputStream 内の getStreamIOException - エラーが発生した場合。
protected void thresholdReached()
throws IOException
ThresholdingOutputStream 内の thresholdReachedIOException - エラーが発生した場合。
public boolean isInMemory()
true データがメモリを使用している場合;
false それ以外の場合。
true if the data is available in memory;
false otherwise.public byte[] getData()
null を返します。
null.
null 。
null if no such
data is available.public File getFile()
File にして返します。
データがメモリ上にある場合には、このメソッドは null を返します。
File, assuming
that the data was written to disk. If the data was retained in memory,
this method returns null.
null 。
Fileを常に返します。]null if no such
file exists.
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||