Package com.google.api.client.util
Class ByteArrayStreamingContent
- java.lang.Object
-
- com.google.api.client.util.ByteArrayStreamingContent
-
- All Implemented Interfaces:
StreamingContent
public class ByteArrayStreamingContent extends java.lang.Object implements StreamingContent
Streaming content whose source is a byte array.Implementation is not thread-safe.
- Since:
- 1.14
-
-
Constructor Summary
Constructors Constructor Description ByteArrayStreamingContent(byte[] byteArray)
ByteArrayStreamingContent(byte[] byteArray, int offset, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeTo(java.io.OutputStream out)
Writes the byte content to the given output stream.
-
-
-
Constructor Detail
-
ByteArrayStreamingContent
public ByteArrayStreamingContent(byte[] byteArray)
- Parameters:
byteArray
- byte array content
-
ByteArrayStreamingContent
public ByteArrayStreamingContent(byte[] byteArray, int offset, int length)
- Parameters:
byteArray
- byte array contentoffset
- starting offset into the byte arraylength
- of bytes to read from byte array
-
-
Method Detail
-
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOException
Description copied from interface:StreamingContent
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 the output stream has not been closed, and will fail to work if it has been closed.
- Specified by:
writeTo
in interfaceStreamingContent
- Parameters:
out
- output stream- Throws:
java.io.IOException
-
-