public class

ByteArrayBodyGenerator

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

Class Overview

A BodyGenerator backed by a byte array.

Summary

Nested Classes
class ByteArrayBodyGenerator.ByteBody  
Public Constructors
ByteArrayBodyGenerator(byte[] bytes)
Public Methods
Body createBody()
Creates a new instance of the request body to be read.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.client.BodyGenerator

Public Constructors

public ByteArrayBodyGenerator (byte[] bytes)

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