Package java.io

Examples of java.io.BufferedInputStream.skip()


            out = new BufferedOutputStream(
                    new DataOutputStream(data.getOutputStream()), transferBufferSize*2);
           
            // if resuming, we skip over the unwanted bytes
            if (resume) {
                in.skip(resumeMarker);
            }
   
            byte[] buf = new byte[transferBufferSize];
            byte[] prevBuf = null;
   
View Full Code Here


       flipped = !flipped;
    }
   
    // Skip image ID
    if (idLength > 0) {
      bis.skip(idLength);
    }
   
    byte[] rawData = null;
    if ((pixelDepth == 32) || (forceAlpha)) {
      pixelDepth = 32;
View Full Code Here

            break;
          }
        }
        long needSkip = len;
        while (needSkip > 0) {
          long skipped = input.skip(needSkip);
          needSkip -= skipped;
        }
        if (firstByte == (byte) 0xFF && len == 0) {
          return CloseReason.REMOTE_CLOSE_REQUEST;
        } else {
View Full Code Here

        for (int i = 0; i < 256; i++) {
            bytes[i] = (byte) i;
        }
        InputStream in = new BufferedInputStream(
                new ByteArrayInputStream(bytes), 12);
        in.skip(6);
        in.mark(14);
        in.read(new byte[14], 0, 14);
        in.reset();
        assertTrue("Wrong bytes", in.read() == 6 && in.read() == 7);
View Full Code Here

        in.read(new byte[14], 0, 14);
        in.reset();
        assertTrue("Wrong bytes", in.read() == 6 && in.read() == 7);

        in = new BufferedInputStream(new ByteArrayInputStream(bytes), 12);
        in.skip(6);
        in.mark(8);
        in.skip(7);
        in.reset();
        assertTrue("Wrong bytes 2", in.read() == 6 && in.read() == 7);
View Full Code Here

        assertTrue("Wrong bytes", in.read() == 6 && in.read() == 7);

        in = new BufferedInputStream(new ByteArrayInputStream(bytes), 12);
        in.skip(6);
        in.mark(8);
        in.skip(7);
        in.reset();
        assertTrue("Wrong bytes 2", in.read() == 6 && in.read() == 7);

        BufferedInputStream buf = new BufferedInputStream(
                new ByteArrayInputStream(new byte[] { 0, 1, 2, 3, 4 }), 2);
View Full Code Here

                buf1.length).equals(fileString.substring(1000, 1010)));

        // regression for HARMONY-667
        try {
            BufferedInputStream buf = new BufferedInputStream(null, 5);
            buf.skip(10);
            fail("Should throw IOException");
        } catch (IOException e) {
            // Expected
        }
    }
View Full Code Here

        byte[] input = "12345678900".getBytes();
        BufferedInputStream buffis = new BufferedInputStream(
                new ByteArrayInputStream(input));
        buffis.read();
        buffis.mark(5);
        buffis.skip(5);
        buffis.reset();
    }

    /**
     * @tests java.io.BufferedInputStream#reset()
View Full Code Here

    public void test_reset_scenario2() throws IOException {
        byte[] input = "12345678900".getBytes();
        BufferedInputStream buffis = new BufferedInputStream(
                new ByteArrayInputStream(input));
        buffis.mark(5);
        buffis.skip(6);
        buffis.reset();
    }

    /**
     * @tests java.io.BufferedInputStream#skip(long)
View Full Code Here

                buf1.length).equals(fileString.substring(1000, 1010)));

        // regression for HARMONY-667
        try {
            BufferedInputStream buf = new BufferedInputStream(null, 5);
            buf.skip(10);
            fail("Should throw IOException");
        } catch (IOException e) {
            // Expected
        }
    }
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.