Package java.io

Examples of java.io.InputStream.reset()


        if (new String(b, "US-ASCII").equalsIgnoreCase("StartFontMetrics")) {
            //Found the header of a AFM file!
            throw new IOException("Cannot parse PFM file. You probably specified the AFM file"
                    + " of a Type 1 font as parameter instead of the PFM.");
        }
        bufin.reset();
        final int version = in.readShort();
        if (version != 256) {
            log.warn("PFM version expected to be '256' but got '" + version + "'."
                    + " Please make sure you specify the PFM as parameter"
                    + " and not the PFB or the AFM.");
View Full Code Here


            log.warn("PFM version expected to be '256' but got '" + version + "'."
                    + " Please make sure you specify the PFM as parameter"
                    + " and not the PFB or the AFM.");
        }
        //final long filesize = in.readInt();
        bufin.reset();

        loadHeader(in);
        loadExtension(in);
    }
View Full Code Here

        assertEquals(rbuf1.length, r1);
        r2 = is.read(rbuf2);
        assertEquals(rbuf2.length, r2);

        try {
            is.reset();
            fail();
        } catch (IOException expected) {
        }
        is.close();
View Full Code Here

        ZipEntry zentry2 = zfile.getEntry("File3.txt");
        is = zfile.getInputStream(zentry2);
        r1 = is.read(rbuf3);
        assertEquals(4183, r1);
        try {
            is.reset();
            fail();
        } catch (IOException expected) {
        }
        is.close();
View Full Code Here

        is = zfile.getInputStream(zentry2);
        r1 = is.read(rbuf3, 0, 3000);
        assertEquals(3000, r1);
        try {
            is.reset();
            fail();
        } catch (IOException expected) {
        }
        is.close();
    }
View Full Code Here

        r = is.read(rbuf1);
        assertEquals(8, r);
        assertEquals(-1, is.read());

        try {
            is.reset();
            fail();
        } catch (IOException expected) {
        }

        is.close();
View Full Code Here

        r = is.read(rbuf3);
        assertEquals(1183, r);
        assertEquals(-1, is.read());

        try {
            is.reset();
            fail();
        } catch (IOException expected) {
        }

        is.close();
View Full Code Here

                    wrapped.mark(readlimit);
                }

                @Override
                public void reset() throws IOException {
                    wrapped.reset();
                }

                @Override
                public void close() throws IOException {
                    logger.debug("Closing CIFS input stream for {}", CifsFile.this.smbFile.getUncPath());
View Full Code Here

                    wrapped.mark(readlimit);
                }

                @Override
                public void reset() throws IOException {
                    wrapped.reset();
                }

                @Override
                public void close() throws IOException {
                    logger.info("Closing SFTP input stream for {}", SshSftpFile.this);
View Full Code Here

        try {
            if (guard != null) {
                byte[] bytes = stateString.getBytes();
                int numRead = bis.read(bytes, 0, bytes.length);
                byte[] decodedBytes = new byte[numRead];
                bis.reset();
                bis.read(decodedBytes, 0, decodedBytes.length);

                bytes = guard.decrypt(decodedBytes);
                if (bytes == null) return null;
                bis = new ByteArrayInputStream(bytes);
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.