Class ByteBufferContentProvider

java.lang.Object
org.eclipse.jetty.client.util.AbstractTypedContentProvider
org.eclipse.jetty.client.util.ByteBufferContentProvider
All Implemented Interfaces:
Iterable<ByteBuffer>, ContentProvider, ContentProvider.Typed

@Deprecated public class ByteBufferContentProvider extends AbstractTypedContentProvider
Deprecated.
A ContentProvider for ByteBuffers.

The position and limit of the ByteBuffers passed to the constructor are not modified, and each invocation of the iterator() method returns a slice of the original ByteBuffer.

  • Constructor Details

    • ByteBufferContentProvider

      public ByteBufferContentProvider(ByteBuffer... buffers)
      Deprecated.
    • ByteBufferContentProvider

      public ByteBufferContentProvider(String contentType, ByteBuffer... buffers)
      Deprecated.
  • Method Details

    • getLength

      public long getLength()
      Deprecated.
      Returns:
      the content length, if known, or -1 if the content length is unknown
    • isReproducible

      public boolean isReproducible()
      Deprecated.
      Description copied from interface: ContentProvider

      Whether this ContentProvider can produce exactly the same content more than once.

      Implementations should return true only if the content can be produced more than once, which means that invocations to Iterable.iterator() must return a new, independent, iterator instance over the content.

      The HttpClient implementation may use this method in particular cases where it detects that it is safe to retry a request that failed.

      Returns:
      whether the content can be produced more than once
    • iterator

      public Iterator<ByteBuffer> iterator()
      Deprecated.