Examples of TFileOutputStream


Examples of de.schlichtherle.truezip.file.TFileOutputStream

        removeObsoleteFile(jarEntry);
        createNewFile(patchFile, jarEntry);
    }

    public static void extractFromJar(final File fileNew, final TFile jarEntry) {
        TFileOutputStream outputStream = null;
        TFileInputStream inputStream = null;
        try {
            outputStream = new TFileOutputStream(fileNew);
            inputStream = new TFileInputStream(jarEntry);

            ByteStreams.copy(inputStream, outputStream);
        } catch (Exception ignored) {
        } finally {
View Full Code Here

Examples of de.schlichtherle.truezip.file.TFileOutputStream

        return new TFile(format("{0}/{1}/{2}", jarFile.getAbsolutePath(), dirInJar, targetFileName));
    }

    private static void createNewFile(final TFile patchFilePath, final TFile jar) {
        TFileInputStream inputStream = null;
        TFileOutputStream outputStream = null;
        try {
            inputStream = new TFileInputStream(patchFilePath);
            outputStream = new TFileOutputStream(jar);

            ByteStreams.copy(inputStream, outputStream);
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
View Full Code Here

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

Examples of net.java.truevfs.access.TFileOutputStream

                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
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.