Class HttpInput.SpecialContent

  • All Implemented Interfaces:
    org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.thread.Invocable
    Direct Known Subclasses:
    HttpInput.EofContent, HttpInput.ErrorContent
    Enclosing class:
    HttpInput

    public abstract static class HttpInput.SpecialContent
    extends HttpInput.Content
    Abstract class that implements the standard special content behavior.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback

        org.eclipse.jetty.util.Callback.Completable, org.eclipse.jetty.util.Callback.Completing, org.eclipse.jetty.util.Callback.InvocableCallback, org.eclipse.jetty.util.Callback.Nested
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable

        org.eclipse.jetty.util.thread.Invocable.InvocationType
    • Field Summary

      • Fields inherited from interface org.eclipse.jetty.util.Callback

        NOOP
      • Fields inherited from interface org.eclipse.jetty.util.thread.Invocable

        __nonBlocking
    • Constructor Summary

      Constructors 
      Constructor Description
      SpecialContent()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int get​(byte[] buffer, int offset, int length)
      Read the wrapped byte buffer.
      java.nio.ByteBuffer getByteBuffer()
      Get the wrapped byte buffer.
      boolean hasContent()
      Check if there is at least one byte left in the buffer.
      boolean isEmpty()
      Check if the buffer is empty.
      boolean isSpecial()
      Check if the content is special.
      int remaining()
      Get the number of bytes remaining in the buffer.
      int skip​(int length)
      Skip some bytes from the buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.Callback

        failed, succeeded
    • Constructor Detail

      • SpecialContent

        public SpecialContent()
    • Method Detail

      • getByteBuffer

        public final java.nio.ByteBuffer getByteBuffer()
        Description copied from class: HttpInput.Content
        Get the wrapped byte buffer. Throws IllegalStateException if the content is special.
        Overrides:
        getByteBuffer in class HttpInput.Content
        Returns:
        the wrapped byte buffer.
      • get

        public final int get​(byte[] buffer,
                             int offset,
                             int length)
        Description copied from class: HttpInput.Content
        Read the wrapped byte buffer. Throws IllegalStateException if the content is special.
        Overrides:
        get in class HttpInput.Content
        Parameters:
        buffer - The array into which bytes are to be written.
        offset - The offset within the array of the first byte to be written.
        length - The maximum number of bytes to be written to the given array.
        Returns:
        The amount of bytes read from the buffer.
      • skip

        public final int skip​(int length)
        Description copied from class: HttpInput.Content
        Skip some bytes from the buffer. Has no effect on a special content.
        Overrides:
        skip in class HttpInput.Content
        Parameters:
        length - How many bytes to skip.
        Returns:
        How many bytes were skipped.
      • hasContent

        public final boolean hasContent()
        Description copied from class: HttpInput.Content
        Check if there is at least one byte left in the buffer. Always false on a special content.
        Overrides:
        hasContent in class HttpInput.Content
        Returns:
        true if there is at least one byte left in the buffer.
      • remaining

        public final int remaining()
        Description copied from class: HttpInput.Content
        Get the number of bytes remaining in the buffer. Always 0 on a special content.
        Overrides:
        remaining in class HttpInput.Content
        Returns:
        the number of bytes remaining in the buffer.
      • isEmpty

        public final boolean isEmpty()
        Description copied from class: HttpInput.Content
        Check if the buffer is empty. Always true on a special content.
        Overrides:
        isEmpty in class HttpInput.Content
        Returns:
        true if there is 0 byte left in the buffer.
      • isSpecial

        public final boolean isSpecial()
        Description copied from class: HttpInput.Content
        Check if the content is special.
        Overrides:
        isSpecial in class HttpInput.Content
        Returns:
        true if the content is special, false otherwise.