public class FileResponseStream extends ServletOutputStream
FileFilter で使用する、File圧縮するServletOutputStreamクラスです。
修飾子とタイプ | フィールドと説明 |
---|---|
protected java.io.ByteArrayOutputStream |
filestream
内部出力ストリーム
|
protected boolean |
isClosed
クローズ判定
|
protected ServletOutputStream |
output
サーブレット出力ストリーム
|
コンストラクタと説明 |
---|
FileResponseStream(ServletResponse response,
java.lang.String filename)
コンストラクター
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
close()
このストリームを閉じ、このストリームに関連するすべてのシステムリソースを解放します。
|
boolean |
closed()
すでにストリームが閉じられているかどうかを返します。
|
void |
flush()
この出力ストリームをフラッシュし、バッファに入っている出力バイトをすべて強制的書き込みますに。
|
boolean |
isReady()
Tomcat8 / Servlet 3.1 で追加された abstract メソッド。
|
void |
setWriteListener(WriteListener listener)
Tomcat8 / Servlet 3.1 で追加された abstract メソッド。
|
void |
write(byte[] bt)
指定されたバイト配列からこの出力ストリームに b.length バイトを書き込みます。
|
void |
write(byte[] bt,
int off,
int len)
オフセット off から始まる指定のバイト配列からこの出力ストリームに len バイトを書き込みます。
|
void |
write(int bt)
この出力ストリームに指定されたバイトを書き込みます。
|
protected java.io.ByteArrayOutputStream filestream
protected boolean isClosed
protected ServletOutputStream output
public FileResponseStream(ServletResponse response, java.lang.String filename) throws java.io.IOException
response
- レスポンスfilename
- ファイル名java.io.IOException
- 入出力エラーが発生したときpublic void close() throws java.io.IOException
close
インタフェース内 java.io.Closeable
close
インタフェース内 java.lang.AutoCloseable
close
クラス内 java.io.OutputStream
java.io.IOException
- 入出力エラーが発生したときpublic void flush() throws java.io.IOException
flush
インタフェース内 java.io.Flushable
flush
クラス内 java.io.OutputStream
java.io.IOException
- 入出力エラーが発生したときpublic void write(int bt) throws java.io.IOException
write
クラス内 java.io.OutputStream
bt
- byteデータjava.io.IOException
- 入出力エラーが発生したときpublic void write(byte[] bt) throws java.io.IOException
write
クラス内 java.io.OutputStream
bt
- バイト配列java.io.IOException
- 入出力エラーが発生したときpublic void write(byte[] bt, int off, int len) throws java.io.IOException
write
クラス内 java.io.OutputStream
bt
- バイト配列off
- オフセット数len
- 書き込みバイト数java.io.IOException
- 入出力エラーが発生したときpublic boolean closed()
public boolean isReady()
false
, it will cause a callback to
WriteListener#onWritePossible() when the buffer has emptied. If
this method returns false
no further data must be written
until the contain calls WriteListener#onWritePossible().isReady
クラス内 ServletOutputStream
public void setWriteListener(WriteListener listener)
setWriteListener
クラス内 ServletOutputStream
listener
- The non-blocking IO write listenerjava.lang.IllegalStateException
- If this method is called if neither
async nor HTTP upgrade is in progress or
if the WriteListener has already
been setjava.lang.NullPointerException
- If listener is nullWebアプリケーションフレームワーク openGionCopyright (c) 2009 The openGion Project.