public class

ByteArrayPartSource

extends Object
implements PartSource
java.lang.Object
   ↳ com.ning.http.multipart.ByteArrayPartSource

Class Overview

This class is an adaptation of the Apache HttpClient implementationhttp://hc.apache.org/httpclient-3.x/

Summary

Public Constructors
ByteArrayPartSource(String fileName, byte[] bytes)
Constructor for ByteArrayPartSource.
Public Methods
InputStream createInputStream()
Gets a new InputStream for reading this source.
String getFileName()
Gets the name of the file this source represents.
long getLength()
Gets the number of bytes contained in this source.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.multipart.PartSource

Public Constructors

public ByteArrayPartSource (String fileName, byte[] bytes)

Constructor for ByteArrayPartSource.

Parameters
fileName the name of the file these bytes represent
bytes the content of this part

Public Methods

public InputStream createInputStream ()

Gets a new InputStream for reading this source. This method can be called more than once and should therefore return a new stream every time.

Returns
  • a new InputStream
Throws
IOException

public String getFileName ()

Gets the name of the file this source represents.

Returns
  • the fileName used for posting a MultiPart file part
See Also

public long getLength ()

Gets the number of bytes contained in this source.

Returns
  • a value >= 0
See Also