public class

InputStreamBodyGenerator

extends Object
implements BodyGenerator
java.lang.Object
   ↳ com.ning.http.client.generators.InputStreamBodyGenerator

Class Overview

A BodyGenerator which use an InputStream for reading bytes, without having to read the entire stream in memory.

NOTE: The InputStream must support the mark(int) and reset() operation. If not, mechanisms like authentication, redirect, or resumable download will not works.

Summary

Nested Classes
class InputStreamBodyGenerator.ISBody  
Public Constructors
InputStreamBodyGenerator(InputStream inputStream)
Public Methods
Body createBody()
Creates a new instance of the request body to be read.
void patchNettyChunkingIssue(boolean patchNettyChunkingIssue)
HACK: This is required because Netty has issues with chunking.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.client.BodyGenerator

Public Constructors

public InputStreamBodyGenerator (InputStream inputStream)

Public Methods

public Body createBody ()

Creates a new instance of the request body to be read. While each invocation of this method is supposed to create a fresh instance of the body, the actual contents of all these body instances is the same. For example, the body needs to be resend after an authentication challenge of a redirect.

Returns
  • The request body, never null.
Throws
IOException

public void patchNettyChunkingIssue (boolean patchNettyChunkingIssue)

HACK: This is required because Netty has issues with chunking.