Package javax.imageio.stream

Examples of javax.imageio.stream.MemoryCacheImageInputStream.seek()


        h.check(exceptionThrown);

        exceptionThrown = false;
        try
          {
            i.seek(2);
          }
        catch (IndexOutOfBoundsException e)
          {
            exceptionThrown = true;
          }
View Full Code Here


        h.check(exceptionThrown);

        exceptionThrown = false;
        try
          {
            i.seek(3);
          }
        catch (IndexOutOfBoundsException e)
          {
            exceptionThrown = true;
          }
View Full Code Here

        h.check(i.isCachedMemory() == true);

        h.check(i.length() == -1);

        // Test mark() and reset().
        i.seek(4);
        i.mark();

        i.read();
        i.read();
View Full Code Here

        bs = new ByteArrayInputStream(b);
        i = new MemoryCacheImageInputStream(bs);

        // Test readBits().
        i.seek(5);
        i.setBitOffset(6);

        exceptionThrown = false;
        try
          {
View Full Code Here

          }
        h.check(exceptionThrown);

        h.check(i.readBits(59) == 366848453836545810L);

        i.seek(5);
        i.setBitOffset(6);
        h.check(i.readBits(58) == 183424226918272905L);

        b = new byte[]
          {
View Full Code Here

        bs = new ByteArrayInputStream(b);
        i = new MemoryCacheImageInputStream(bs);

        long[] res = new long[8];

        i.seek(0);

        h.check(i.readBits(0) == 0);
        i.seek(0);

        for (k = 0; k < 8; k++)
View Full Code Here

        long[] res = new long[8];

        i.seek(0);

        h.check(i.readBits(0) == 0);
        i.seek(0);

        for (k = 0; k < 8; k++)
          {
            i.setBitOffset(k);
            res[k] = i.readBits(8);
View Full Code Here

        // Reformat.
        long iisPosition = 0L;
        int y = raster.getMinY();
        for(int j = 0; j < h; j++, y++) {
            iis.seek(iisPosition);
            int x = raster.getMinX();
            for(int i = 0; i < w; i++, x++) {
                for(int b = 0; b < numBands; b++) {
                    long bits = iis.readBits(sampleSize[b]);
                    raster.setSample(x, y, b, (int)bits);
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.