Package jodd.http

Class Buffer


  • public class Buffer
    extends java.lang.Object
    Holds request/response content until it is actually send. File content (i.e. Uploadable) is not read until it is really used.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.ByteArrayOutputStream last  
      protected java.util.LinkedList<java.lang.Object> list  
      protected int size  
    • Constructor Summary

      Constructors 
      Constructor Description
      Buffer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Buffer append​(char c)
      Appends a char.
      Buffer append​(int number)
      Appends a number.
      Buffer append​(java.lang.String string)
      Appends string content to buffer.
      Buffer append​(Buffer buffer)
      Appends other buffer to this one.
      Buffer append​(Uploadable uploadable)
      Appends Uploadable to buffer.
      private void ensureLast()
      Ensures that last buffer exist.
      int size()
      Returns buffer size.
      void writeTo​(java.io.OutputStream out)
      Writes content to the output stream.
      void writeTo​(java.io.OutputStream out, HttpProgressListener progressListener)
      Writes content to the output stream, using progress listener to track the sending progress.
      void writeTo​(java.io.Writer writer)
      Writes content to the writer.
      • Methods inherited from class java.lang.Object

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

      • list

        protected java.util.LinkedList<java.lang.Object> list
      • last

        protected java.io.ByteArrayOutputStream last
      • size

        protected int size
    • Constructor Detail

      • Buffer

        public Buffer()
    • Method Detail

      • append

        public Buffer append​(java.lang.String string)
        Appends string content to buffer.
      • append

        public Buffer append​(char c)
        Appends a char.
      • append

        public Buffer append​(int number)
        Appends a number.
      • append

        public Buffer append​(Buffer buffer)
        Appends other buffer to this one.
      • size

        public int size()
        Returns buffer size.
      • ensureLast

        private void ensureLast()
        Ensures that last buffer exist.
      • writeTo

        public void writeTo​(java.io.Writer writer)
                     throws java.io.IOException
        Writes content to the writer.
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Writes content to the output stream.
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream out,
                            HttpProgressListener progressListener)
                     throws java.io.IOException
        Writes content to the output stream, using progress listener to track the sending progress.
        Throws:
        java.io.IOException