Package net.java.truevfs.access

Examples of net.java.truevfs.access.TFileOutputStream


    public static BufferedImage makeThumbnail(BufferedImage original, String path) {
        BufferedImage image = getResizedImage(original, Constants.THUMBNAIL_SIZE_FULL);
        TFile imageFile = new TFile(path);
        try {
            TFileOutputStream outputStream = null;
            try {
                //log.debug("thumbnail path:"+path);
                outputStream = new TFileOutputStream(imageFile);
                ImageIO.write(image, "jpg", outputStream);
            } finally {
                if (outputStream != null) {
                    outputStream.close();
                }
            }
        } catch (IOException e) {
            log.error(e,e);
        }
View Full Code Here


                URLConnection httpConn = url.openConnection(p);
                httpConn.connect();
                if (((HttpURLConnection) httpConn).getResponseCode() == 200) {
                    try (BufferedInputStream in = new BufferedInputStream(((HttpURLConnection) httpConn).getInputStream())) {
                        //try (BufferedInputStream in = new BufferedInputStream(url.openConnection(p).getInputStream())) {
                        out = new BufferedOutputStream(new TFileOutputStream(temporaryFile));
                        byte[] buf = new byte[1024];
                        int len;
                        while ((len = in.read(buf)) != -1) {
                            // user cancelled
                            if (cancel) {
View Full Code Here

TOP

Related Classes of net.java.truevfs.access.TFileOutputStream

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.