com.rt.storage.api.client.util.StreamingContent Maven / Gradle / Ivy
package com.rt.storage.api.client.util;
import java.io.IOException;
import java.io.OutputStream;
/**
* Streaming content interface to write bytes to an output stream.
*
* Implementations don't need to be thread-safe.
*
* @since 1.14
* @author Yaniv Inbar
*/
public 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 output stream has not been closed, and will fail to
* work if it has been closed.
*
* @param out output stream
*/
void writeTo(OutputStream out) throws IOException;
}