クラス GZIPResponseStream

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

GZIPFilter で使用する、GZIP圧縮するServletOutputStreamクラスです。
機能分類
フィルター処理
導入されたバージョン:
JDK5.0,
  • フィールド詳細

  • コンストラクタの詳細

    • GZIPResponseStream

      コンストラクター
      パラメータ:
      response - HttpServletResponseオブジェクト
      例外:
      IOException - 入出力エラーが発生したとき
      変更履歴:
      6.4.1.1 (2016/01/16) PMD refactoring. It is a good practice to call super() in a constructor
  • メソッドの詳細

    • close

      public void close() throws IOException
      このストリームを閉じ、このストリームに関連するすべてのシステムリソースを解放します。 close の汎用規約では、close は出力ストリームを閉じます。閉じられたストリームは 出力処理を実行できません。また、それを開き直すことはできません。
      定義:
      close インタフェース内 AutoCloseable
      定義:
      close インタフェース内 Closeable
      オーバーライド:
      close クラス内 OutputStream
      例外:
      IOException - 入出力エラーが発生したとき
      変更履歴:
      5.1.7.0 (2010/06/01) isClosed == true の場合に Exception でなく、return にする。
    • flush

      public void flush() throws IOException
      この出力ストリームをフラッシュし、バッファに入っている出力バイトをすべて強制的書き込みますに。 flush の汎用規約では、それまでに書き込まれたバイトが出力ストリームの 実装によってバッファに入れられている場合に flush を呼び出すと、それらのバイトは ただちにその目的の転送先に書き込まれます。
      定義:
      flush インタフェース内 Flushable
      オーバーライド:
      flush クラス内 OutputStream
      例外:
      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 ビットは無視されます。
      定義:
      write クラス内 OutputStream
      パラメータ:
      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) を呼び出す 場合とまったく同じです。
      オーバーライド:
      write クラス内 OutputStream
      パラメータ:
      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] です。
      オーバーライド:
      write クラス内 OutputStream
      パラメータ:
      bt - バイト配列
      off - オフセット数
      len - 書き込みバイト数
      例外:
      IOException - 入出力エラーが発生したとき
      変更履歴:
      5.1.7.0 (2010/06/01) isClosed == true の場合に Exception でなく、return にする。
    • closed

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

      public boolean isReady()
      Tomcat8 / Servlet 3.1 で追加された abstract メソッド。 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().
      定義:
      isReady クラス内 ServletOutputStream
      戻り値:
      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
    • setWriteListener

      public void setWriteListener(WriteListener listener)
      Tomcat8 / Servlet 3.1 で追加された abstract メソッド。 Sets the WriteListener for this ServletOutputStream and thereby switches to non-blocking IO. It is only valid to switch to non-blocking IO within async processing or HTTP upgrade processing.
      定義:
      setWriteListener クラス内 ServletOutputStream
      パラメータ:
      listener - The non-blocking IO write listener
      例外:
      IllegalStateException - If this method is called if neither async nor HTTP upgrade is in progress or if the WriteListener has already been set
      NullPointerException - If listener is null
      変更履歴:
      5.6.8.2 (2013/09/20) 新規追加(Tomcat8 / Servlet 3.1 で追加された abstract メソッド)
      導入されたバージョン:
      Servlet 3.1