openGionopenGion
5.8.7.0

org.opengion.hayabusa.filter
クラス GZIPResponseStream

java.lang.Object
  上位を拡張 java.io.OutputStream
      上位を拡張 javax.servlet.ServletOutputStream
          上位を拡張 org.opengion.hayabusa.filter.GZIPResponseStream
すべての実装されたインタフェース:
Closeable, Flushable

public class GZIPResponseStream
extends ServletOutputStream

GZIPFilter で使用する、GZIP圧縮するServletOutputStreamクラスです。

機能分類
フィルター処理
バージョン
4.0
作成者
Kazuhiko Hasegawa
導入されたバージョン:
JDK5.0,

フィールドの概要
protected  ByteArrayOutputStream baos
          内部出力ストリーム
protected  GZIPOutputStream gzipstream
          GZIP出力ストリーム
protected  boolean isClosed
          クローズ判定
protected  ServletOutputStream output
          サーブレット出力ストリーム
protected  HttpServletResponse response
          レスポンスオブジェクト
 
コンストラクタの概要
GZIPResponseStream(HttpServletResponse response)
          コンストラクター
 
メソッドの概要
 void close()
          このストリームを閉じ、このストリームに関連するすべてのシステムリソースを解放します。
 boolean closed()
          すでにストリームが閉じられているかどうかを返します。
 void flush()
          この出力ストリームをフラッシュし、バッファに入っている出力バイトをすべて強制的書き込みますに。
 boolean isReady()
          Checks if a non-blocking write will succeed.
 void write(byte[] bt)
          指定されたバイト配列からこの出力ストリームに b.length バイトを書き込みます。
 void write(byte[] bt, int off, int len)
          オフセット off から始まる指定のバイト配列からこの出力ストリームに len バイトを書き込みます。
 void write(int bt)
          この出力ストリームに指定されたバイトを書き込みます。
 
クラス javax.servlet.ServletOutputStream から継承されたメソッド
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

baos

protected ByteArrayOutputStream baos
内部出力ストリーム


gzipstream

protected GZIPOutputStream gzipstream
GZIP出力ストリーム


isClosed

protected boolean isClosed
クローズ判定


response

protected HttpServletResponse response
レスポンスオブジェクト


output

protected ServletOutputStream output
サーブレット出力ストリーム

コンストラクタの詳細

GZIPResponseStream

public GZIPResponseStream(HttpServletResponse response)
                   throws IOException
コンストラクター

パラメータ:
response - HttpServletResponseオブジェクト
例外:
IOException - 入出力エラーが発生したとき
メソッドの詳細

close

public void close()
           throws IOException
このストリームを閉じ、このストリームに関連するすべてのシステムリソースを解放します。 close の汎用規約では、close は出力ストリームを閉じます。閉じられたストリームは 出力処理を実行できません。また、それを開き直すことはできません。

定義:
インタフェース Closeable 内の close
オーバーライド:
クラス OutputStream 内の close
例外:
IOException - 入出力エラーが発生したとき
変更履歴:
5.1.7.0 (2010/06/01) isClosed == true の場合に Exception でなく、return にする。

flush

public void flush()
           throws IOException
この出力ストリームをフラッシュし、バッファに入っている出力バイトをすべて強制的書き込みますに。 flush の汎用規約では、それまでに書き込まれたバイトが出力ストリームの 実装によってバッファに入れられている場合に flush を呼び出すと、それらのバイトは ただちにその目的の転送先に書き込まれます。

定義:
インタフェース Flushable 内の flush
オーバーライド:
クラス OutputStream 内の flush
例外:
IOException - 入出力エラーが発生したとき
変更履歴:
5.1.7.0 (2010/06/01) isClosed == true の場合に Exception でなく、return にする。

write

public void write(int bt)
           throws IOException
この出力ストリームに指定されたバイトを書き込みます。 write の汎用規約では、1 バイトが 出力ストリームに書き込まれます。書き込まれるバイトは、引数 b の下位 8 ビットです。 b の上位 24 ビットは無視されます。

定義:
クラス OutputStream 内の write
パラメータ:
bt - byteデータ
例外:
IOException - 入出力エラーが発生したとき
変更履歴:
5.1.7.0 (2010/06/01) isClosed == true の場合に Exception でなく、return にする。

write

public void write(byte[] bt)
           throws IOException
指定されたバイト配列からこの出力ストリームに b.length バイトを書き込みます。 write(b) の汎用規約では、write(b) の効果は write(b, 0, b.length) を呼び出す 場合とまったく同じです。

オーバーライド:
クラス OutputStream 内の write
パラメータ:
bt - バイト配列
例外:
IOException - 入出力エラーが発生したとき

write

public void write(byte[] bt,
                  int off,
                  int len)
           throws IOException
オフセット off から始まる指定のバイト配列からこの出力ストリームに len バイトを書き込みます。 write(b, off, len) の汎用規約では、配列 b 内の一定のバイトが出力ストリームに順番に 書き込まれます。この処理で最初に書き込まれるバイトは要素 b[off]、最後に書き込まれる バイトは要素 b[off+len-1] です。

オーバーライド:
クラス OutputStream 内の write
パラメータ:
bt - バイト配列
off - オフセット数
len - 書き込みバイト数
例外:
IOException - 入出力エラーが発生したとき
変更履歴:
5.1.7.0 (2010/06/01) isClosed == true の場合に Exception でなく、return にする。

closed

public boolean closed()
すでにストリームが閉じられているかどうかを返します。

戻り値:
すでにストリームが閉じられているかどうか

isReady

public boolean isReady()
Checks if a non-blocking write will succeed. If this returns 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().

戻り値:
true:書き込み可能/false:不可 (true if data can be written, else false)
変更履歴:
5.6.8.2 (2013/09/20) 新規追加(Tomcat8 / Servlet 3.1 で追加された abstract メソッド)
導入されたバージョン:
Servlet 3.1

openGion 5.8.7.0

Webアプリケーションフレームワーク openGion
SourceForge.JPCopyright (c) 2009 The openGion Project.