Package java.io

Examples of java.io.FileInputStream.mark()


                    || "gzip".equals(contentEncoding)
                    || "x-gzip".equals(contentEncoding)) {               
                return new GZIPInputStream(new FileInputStream(file));
            } else if (fileName.endsWith(".bz2")) {
                InputStream is = new FileInputStream(file);
                is.mark(4);
                if (!(is.read() == 'B' && is.read() == 'Z')) {
                    // No BZ prefix as appended by command line tools.  Reset and hope for the best
                    is.reset();
                }
                return new CBZip2InputStream(is);
View Full Code Here


    in = new BufferedInputStream(in);

    System.out.println("Is mark supported: " + in.markSupported());

    // 2 GB limit
    in.mark(4096);

    in.read();

    in.reset();
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.