com.rt.storage.api.client.http.HttpEncoding Maven / Gradle / Ivy
package com.rt.storage.api.client.http;
import com.rt.storage.api.client.util.StreamingContent;
import java.io.IOException;
import java.io.OutputStream;
/**
* HTTP content encoding.
*
* Implementations don't need to be thread-safe.
*
* @since 1.14
* @author Yaniv Inbar
*/
public interface HttpEncoding {
/** Returns the content encoding name (for example {@code "gzip"}) or {@code null} for none. */
String getName();
/**
* Encodes the streaming content into the 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 content streaming content
* @param out output stream
*/
void encode(StreamingContent content, OutputStream out) throws IOException;
}