public interface

Body

com.ning.http.client.Body
Known Indirect Subclasses

Class Overview

A request body.

Summary

Public Methods
abstract void close()
Releases any resources associated with this body.
abstract long getContentLength()
Gets the length of the body.
abstract long read(ByteBuffer buffer)
Reads the next chunk of bytes from the body.

Public Methods

public abstract void close ()

Releases any resources associated with this body.

Throws
IOException

public abstract long getContentLength ()

Gets the length of the body.

Returns
  • The length of the body in bytes, or negative if unknown.

public abstract long read (ByteBuffer buffer)

Reads the next chunk of bytes from the body.

Parameters
buffer The buffer to store the chunk in, must not be null.
Returns
  • The non-negative number of bytes actually read or -1 if the body has been read completely.
Throws
IOException If the chunk could not be read.