// TODO: Don't compress tiny content or already compressed data
// (based on mimetype). This is harder than it sounds.
private InputStream getEncodedStream(ContentEncoding contentEncoding,
InputStream content, boolean wrapLines, int ioBufferSize) {
if (contentEncoding == ContentEncoding.BASE64COMPRESSED) {
return new Base64FilterInputStream(
new CompressedFilterInputStream(content, ioBufferSize), wrapLines);
} else {
return new Base64FilterInputStream(content, wrapLines);
}
}