Package net.wastl.webmail.ui.html

Examples of net.wastl.webmail.ui.html.HTMLImage


                    /*
                     * What we will send is an image or some other sort of
                     * binary
                     */
                    if (content instanceof HTMLImage) {
                        final HTMLImage img = (HTMLImage) content;
                        /*
                         * the HTMLImage class provides us with most of the
                         * necessary information that we want to send
                         */
                        res.setHeader("Content-Type", img.getContentType());
                        res.setHeader("Content-Transfer-Encoding",
                                img.getContentEncoding());
                        res.setHeader("Content-Length", "" + img.size());
                        res.setHeader("Connection", "Keep-Alive");

                        /* Send 8k junks */
                        int offset = 0;
                        while (offset + chunk_size < img.size()) {
                            out.write(img.toBinary(), offset, chunk_size);
                            offset += chunk_size;
                        }
                        out.write(img.toBinary(), offset, img.size() - offset);
                        out.flush();

                        out.close();
                    } else {
                        final byte[] encoded_content =
View Full Code Here

TOP

Related Classes of net.wastl.webmail.ui.html.HTMLImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.