JavaScript is disabled on your browser.
gnu.inet.http

Class ByteArrayRequestBodyWriter

  • All Implemented Interfaces:
    RequestBodyWriter


    public class ByteArrayRequestBodyWriter
    extends java.lang.Object
    implements RequestBodyWriter 
    A simple request body writer using a byte array.
    • Field Summary

      Fields
      Modifier and Type Field and Description
      protected byte[] content
      The content.
      protected int pos
      The position within the content at which the next read will occur.
    • Constructor Summary

      Constructors
      Constructor and Description
      ByteArrayRequestBodyWriter (byte[] content)
      Constructs a new byte array request body writer with the specified content.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      long getContentLength ()
      Returns the total number of bytes that will be written in a single pass by this writer.
      void reset ()
      Initialises the writer.
      int write (byte[] buffer)
      Writes body content to the supplied buffer.
      • Methods inherited from class java.lang.Object

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

      • content

        protected byte[] content
        The content.
      • pos

        protected int pos
        The position within the content at which the next read will occur.
    • Constructor Detail

      • ByteArrayRequestBodyWriter

        public ByteArrayRequestBodyWriter(byte[] content)
        Constructs a new byte array request body writer with the specified content.
        Parameters:
        content - the content buffer
    • Method Detail

      • getContentLength

        public long getContentLength()
        Returns the total number of bytes that will be written in a single pass by this writer.
        Specified by:
        getContentLength in interface RequestBodyWriter
      • reset

        public void reset()
        Initialises the writer. This will be called before each pass.
        Specified by:
        reset in interface RequestBodyWriter
      • write

        public int write(byte[] buffer)
        Writes body content to the supplied buffer.
        Specified by:
        write in interface RequestBodyWriter
        Parameters:
        buffer - the content buffer
        Returns:
        the number of bytes written

AltStyle によって変換されたページ (->オリジナル) /