Class Request.HttpOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    Enclosing class:
    Request

    public static class Request.HttpOutputStream
    extends java.io.FilterOutputStream
    The HttpOutputStream provides the convenience method writeBytes for writing the byte representation of a string, without bringing in the overhead and the deprecated warnings associated with a java.io.DataOutputStream.

    The other methods in this class are here to allow the FilterHandler and ChainSawHandler to alter the behavior in an implementation specific way. This behavior is unfortunate, and might go away when a better strategy comes along.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int bytesWritten
      Count the number of bytes that are written to this stream
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpOutputStream​(java.io.OutputStream out)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void sendHeaders​(Request request)  
      void write​(byte b)  
      void write​(byte[] buf, int off, int len)  
      void writeBytes​(java.lang.String s)  
      • Methods inherited from class java.io.FilterOutputStream

        close, flush, write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • bytesWritten

        public int bytesWritten
        Count the number of bytes that are written to this stream
    • Constructor Detail

      • HttpOutputStream

        public HttpOutputStream​(java.io.OutputStream out)
    • Method Detail

      • writeBytes

        public void writeBytes​(java.lang.String s)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(byte b)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] buf,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • sendHeaders

        public void sendHeaders​(Request request)
                         throws java.io.IOException
        Throws:
        java.io.IOException