Class ByteArrayBodyGenerator

  extended by com.ning.http.client.generators.ByteArrayBodyGenerator
All Implemented Interfaces:

public class ByteArrayBodyGenerator
extends Object
implements BodyGenerator

A BodyGenerator backed by a byte array.

Nested Class Summary
protected  class ByteArrayBodyGenerator.ByteBody
Constructor Summary
ByteArrayBodyGenerator(byte[] bytes)
Method Summary
 Body createBody()
          Creates a new instance of the request body to be read.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ByteArrayBodyGenerator(byte[] bytes)
Method Detail


public Body createBody()
                throws IOException
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.

Specified by:
createBody in interface BodyGenerator
The request body, never null.
IOException - If the body could not be created.

Copyright © 2014. All Rights Reserved.