Class ByteArrayStreamingContent (1.43.1)

public class ByteArrayStreamingContent implements StreamingContent

Deprecated. use com.google.common.io.ByteSource

Streaming content whose source is a byte array.

Implementation is not thread-safe.

Inheritance

java.lang.Object > ByteArrayStreamingContent

Implements

StreamingContent

Constructors

ByteArrayStreamingContent(byte[] byteArray) (deprecated)

public ByteArrayStreamingContent(byte[] byteArray)
Parameter
NameDescription
byteArraybyte[]

byte array content

ByteArrayStreamingContent(byte[] byteArray, int offset, int length) (deprecated)

public ByteArrayStreamingContent(byte[] byteArray, int offset, int length)
Parameters
NameDescription
byteArraybyte[]

byte array content

offsetint

starting offset into the byte array

lengthint

of bytes to read from byte array

Methods

writeTo(OutputStream out) (deprecated)

public void writeTo(OutputStream out)

Writes the byte content to the given output stream.

Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.

Parameter
NameDescription
outOutputStream
Exceptions
TypeDescription
IOException