public class ByteArrayStreamingContent extends java.lang.Object implements StreamingContent
Implementation is not thread-safe.
Constructor and Description |
---|
ByteArrayStreamingContent(byte[] byteArray) |
ByteArrayStreamingContent(byte[] byteArray,
int offset,
int length) |
Modifier and Type | Method and Description |
---|---|
void |
writeTo(java.io.OutputStream out)
Writes the byte content to the given output stream.
|
public ByteArrayStreamingContent(byte[] byteArray)
byteArray
- byte array contentpublic ByteArrayStreamingContent(byte[] byteArray, int offset, int length)
byteArray
- byte array contentoffset
- starting offset into the byte arraylength
- of bytes to read from byte arraypublic void writeTo(java.io.OutputStream out) throws java.io.IOException
StreamingContent
Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the the output stream has not been closed, and will fail to work if it has been closed.
writeTo
in interface StreamingContent
out
- output streamjava.io.IOException
Copyright © 2011-2018 Google. All Rights Reserved.