class PdfEFStream extends PdfStream {

    /**
     * Creates a Stream object using an InputStream and a PdfWriter object
     *
     * @param in     the InputStream that will be read to get the Stream object
     * @param writer the writer to which the stream will be added
     */
    public PdfEFStream(InputStream in, PdfWriter writer) {
        super(in, writer);
    }

    /**
     * Creates a Stream object using a byte array
     *
     * @param fileStore the bytes for the stream
     */
    public PdfEFStream(byte[] fileStore) {
        super(fileStore);
    }

    /**
     * @see com.lowagie.text.pdf.PdfDictionary#toPdf(com.lowagie.text.pdf.PdfWriter, java.io.OutputStream)
     */
    public void toPdf(PdfWriter writer, OutputStream os) throws IOException {<FILL_FUNCTION_BODY>}
}

        if (inputStream != null && compressed) {
            put(PdfName.FILTER, PdfName.FLATEDECODE);
        }
        PdfEncryption crypto = null;
        if (writer != null) {
            crypto = writer.getEncryption();
        }
        if (crypto != null) {
            PdfObject filter = get(PdfName.FILTER);
            if (filter != null) {
                if (PdfName.CRYPT.equals(filter)) {
                    crypto = null;
                } else if (filter.isArray()) {
                    PdfArray a = (PdfArray) filter;
                    if (!a.isEmpty() && PdfName.CRYPT.equals(a.getPdfObject(0))) {
                        crypto = null;
                    }
                }
            }
        }
        if (crypto != null && crypto.isEmbeddedFilesOnly()) {
            PdfArray filter = new PdfArray();
            PdfArray decodeparms = new PdfArray();
            PdfDictionary crypt = new PdfDictionary();
            crypt.put(PdfName.NAME, PdfName.STDCF);
            filter.add(PdfName.CRYPT);
            decodeparms.add(crypt);
            if (compressed) {
                filter.add(PdfName.FLATEDECODE);
                decodeparms.add(new PdfNull());
            }
            put(PdfName.FILTER, filter);
            put(PdfName.DECODEPARMS, decodeparms);
        }
        PdfObject nn = get(PdfName.LENGTH);
        if (crypto != null && nn != null && nn.isNumber()) {
            int sz = ((PdfNumber) nn).intValue();
            put(PdfName.LENGTH, new PdfNumber(crypto.calculateStreamSize(sz)));
            superToPdf(writer, os);
            put(PdfName.LENGTH, nn);
        } else {
            superToPdf(writer, os);
        }

        os.write(STARTSTREAM);
        if (inputStream != null) {
            rawLength = 0;
            DeflaterOutputStream def = null;
            OutputStreamCounter osc = new OutputStreamCounter(os);
            OutputStreamEncryption ose = null;
            OutputStream fout = osc;
            if (crypto != null) {
                fout = ose = crypto.getEncryptionStream(fout);
            }
            Deflater deflater = null;
            if (compressed) {
                deflater = new Deflater(compressionLevel);
                fout = def = new DeflaterOutputStream(fout, deflater, 0x8000);
            }

            byte[] buf = new byte[4192];
            while (true) {
                int n = inputStream.read(buf);
                if (n <= 0) {
                    break;
                }
                fout.write(buf, 0, n);
                rawLength += n;
            }
            if (def != null) {
                def.finish();
                deflater.end();
            }
            if (ose != null) {
                ose.finish();
            }
            inputStreamLength = osc.getCounter();
        } else {
            if (crypto == null) {
                if (streamBytes != null) {
                    streamBytes.writeTo(os);
                } else {
                    os.write(bytes);
                }
            } else {
                byte[] b;
                if (streamBytes != null) {
                    b = crypto.encryptByteArray(streamBytes.toByteArray());
                } else {
                    b = crypto.encryptByteArray(bytes);
                }
                os.write(b);
            }
        }
        os.write(ENDSTREAM);
    
<methods>public void <init>(byte[]) ,public void <init>(java.io.InputStream, com.lowagie.text.pdf.PdfWriter) ,public void flateCompress() ,public void flateCompress(int) ,public long getRawLength() ,public void toPdf(com.lowagie.text.pdf.PdfWriter, java.io.OutputStream) throws java.io.IOException,public java.lang.String toString() ,public void writeContent(java.io.OutputStream) throws java.io.IOException,public void writeLength() throws java.io.IOException<variables>public static final int BEST_COMPRESSION,public static final int BEST_SPEED,public static final int DEFAULT_COMPRESSION,static final byte[] ENDSTREAM,public static final int NO_COMPRESSION,static final int SIZESTREAM,static final byte[] STARTSTREAM,protected boolean compressed,protected int compressionLevel,protected java.io.InputStream inputStream,protected long inputStreamLength,protected long rawLength,protected com.lowagie.text.pdf.PdfIndirectReference ref,protected java.io.ByteArrayOutputStream streamBytes,protected com.lowagie.text.pdf.PdfWriter writer