Package java.io

Examples of java.io.BufferedInputStream.skip()


    /**
     * @tests java.io.BufferedInputStream#skip(long)
     */
    public void test_skip_NullInputStream() throws IOException {
        BufferedInputStream buf = new BufferedInputStream(null, 5);
        assertEquals(0, buf.skip(0));
    }

    /**
     * Sets up the fixture, for example, open a network connection. This method
     * is called before a test is executed.
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

            if (newLen < 0)
              newLen = 0;

            final long dataLen = newLen;
            InputStream reqIs = new BufferedInputStream(new FileInputStream(file), BUFFER_SIZE);
            reqIs.skip(startFrom);

            res = new Response(HTTP_PARTIALCONTENT, mime, reqIs);
            res.addHeader("Content-Length", "" + dataLen);
            res.addHeader("Content-Range", "bytes " + startFrom + "-" + endAt + "/" + fileLen);
          }
View Full Code Here

              newLen = 0;

            final long dataLen = newLen;
            InputStream reqIs = new BufferedInputStream(
                new FileInputStream(file), BUFFER_SIZE);
            reqIs.skip(startFrom);

            res = new Response(HTTP_PARTIALCONTENT, mime, reqIs);
            res.addHeader("Content-Length", "" + dataLen);
            res.addHeader("Content-Range", "bytes " + startFrom
                + "-" + endAt + "/" + fileLen);
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

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.