ByteArrayOutputStream bos = new ByteArrayOutputStream();
OutputStream os = bos;
if (ImageConstants.ENCODING_ASCII85.equals(encoding)
|| ImageConstants.ENCODING_FLATE_ASCII85.equals(encoding)) {
os = new ASCII85OutputStream(os);
}
if (ImageConstants.ENCODING_FLATE.equals(encoding)
|| ImageConstants.ENCODING_FLATE_ASCII85.equals(encoding)) {
os = new FlateOutputStream(os);