Examples of InputStreamInfo


Examples of com.pegaa.uploader.sender.InputStreamInfo

     * @throws java.io.FileNotFoundException
     */
    @Override
    public InputStreamInfo getInputStream(ListItem item) throws FileNotFoundException {
        FileInputStream fis = null;
        InputStreamInfo info = null;

        try {
            fis = new FileInputStream(item.getFile());
            info = new InputStreamInfo(fis, item.getFile().length());
            return info;
        } catch (FileNotFoundException ex) {
            throw new FileNotFoundException();
        }
    }
View Full Code Here

Examples of com.pegaa.uploader.sender.InputStreamInfo

     * @throws java.io.FileNotFoundException
     */
    @Override
    public InputStreamInfo getInputStream(ListItem item) throws FileNotFoundException {
        FileInputStream fis = null;
        InputStreamInfo info = null;

        try {
            fis = new FileInputStream(item.getFile());
            info = new InputStreamInfo(fis, item.getFile().length());
            return info;
        } catch (FileNotFoundException ex) {
            throw new FileNotFoundException();
        }
    }
View Full Code Here

Examples of com.pegaa.uploader.sender.InputStreamInfo

    public InputStreamInfo getInputStream(ListItem item)
            throws FileNotFoundException {
        BufferedImage image = null;
        ByteArrayOutputStream baos = null;
        ByteArrayInputStream bais = null;
        InputStreamInfo info = null;

        ImageItem imgItem = (ImageItem) item;

        try {
            image = javax.imageio.ImageIO.read(item.getFile());

            //Raz - modify this to send out the filename in an overloaded
            //function of getScaledImageAndRotated
            //in com.pegaa.uploader.tools.ImageFuncs
            File rtmpf = item.getFile();
            String rfilename = rtmpf.getName();
            String rext = rfilename.substring(rfilename.lastIndexOf('.') + 1, rfilename.length());

            image = getScaledImageAndRotated(image, imgItem.getRotationStatus(), rext);

            baos = ImageFuncs.createImageOutputStream(image, rext);

            byte[] resultImageAsRawBytes = baos.toByteArray();
            bais = new ByteArrayInputStream(resultImageAsRawBytes, 0, resultImageAsRawBytes.length);

            info = new InputStreamInfo((InputStream) bais, resultImageAsRawBytes.length);
            /**/
            return info;
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.