Package javax.imageio.stream

Examples of javax.imageio.stream.ImageInputStream.readFully()


                    in.mark();
                    try {
                        reclen = jpeg.readSegmentLength();
                        // Check for ICC profile
                        byte[] iccString = new byte[11];
                        in.readFully(iccString);
                        in.skipBytes(1); //string terminator (null byte)

                        if ("ICC_PROFILE".equals(new String(iccString, "US-ASCII"))) {
                            in.skipBytes(2); //chunk sequence number and total number of chunks
                            int payloadSize = reclen - 2 - 12 - 2;
View Full Code Here


                            if (ignoreColorProfile(hints)) {
                                log.debug("Ignoring ICC profile data in JPEG");
                                in.skipBytes(payloadSize);
                            } else {
                                byte[] buf = new byte[payloadSize];
                                in.readFully(buf);
                                if (iccStream == null) {
                                    if (log.isDebugEnabled()) {
                                        log.debug("JPEG has an ICC profile");
                                        DataInputStream din = new DataInputStream(new ByteArrayInputStream(buf));
                                        log.debug("Declared ICC profile size: " + din.readInt());
View Full Code Here

                    in.mark();
                    try {
                        reclen = jpeg.readSegmentLength();
                        // Check for Adobe header
                        byte[] adobeHeader = new byte[5];
                        in.readFully(adobeHeader);

                        if ("Adobe".equals(new String(adobeHeader, "US-ASCII"))) {
                            // The reason for reading the APPE marker is that Adobe Photoshop
                            // generates CMYK JPEGs with inverted values. The correct thing
                            // to do would be to interpret the values in the marker, but for now
View Full Code Here

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

        byte[] fullB = new byte[26];
        i.seek(0);
        i.readFully(fullB);
        h.check(Arrays.equals(fullB,
                              new byte[]
            {
              (byte) 0x92, (byte) 0x80, (byte) 0x05, (byte) 0x77,
              (byte) 0xac, (byte) 0xf2, (byte) 0x8b, (byte) 0xa7,
View Full Code Here

        for (k = 0; k < fullB.length; k++)
          fullB[k] = 0;

        i.seek(0);
        i.readFully(fullB, 5, 13);

        h.check(Arrays.equals(fullB, new byte[]
            {
              (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
              (byte) 0x00, (byte) 0x92, (byte) 0x80, (byte) 0x05,
View Full Code Here

              (byte) 0x00, (byte) 0x00
            }));

        char[] fullC = new char[15];
        i.seek(0);
        i.readFully(fullC, 0, 15);

        h.check(Arrays.equals(fullC, new char[]
            {
              (char) 37504, (char) 1399, (char) 44274,
              (char) 35751, (char) 23760, (char) 43535,
View Full Code Here

              (char) 44274, (char) 35751, (char) 23760
            }));

        double[] fullD = new double[8];
        i.seek(0);
        i.readFully(fullD, 0, 8);

        h.check(Arrays.equals(fullD, new double[] {
                                -1.4183142849706364E-219,
                                1.2402952421911034E139,
                                -3.154063812740471E-145,
View Full Code Here

                                -3.154063812740471E-145
                              }));

        float[] fullF = new float[16];
        i.seek(0);
        i.readFully(fullF, 0, 16);

        h.check(Arrays.equals(fullF, new float[] {
                                -8.079283E-28f,
                                -6.893558E-12f,
                                4.69870212E17f,
View Full Code Here

                                -8.079283E-28f
                              }));

        int[] fullI = new int[16];
        i.seek(0);
        i.readFully(fullI, 0, 16);

        h.check(Arrays.equals(fullI, new int[] {
                                -1837103753,
                                -1393390681,
                                1557178895,
View Full Code Here

                                -1837103753,
                              }));

        long[] fullL = new long[8];
        i.seek(0);
        i.readFully(fullL, 0, 8);

        h.check(Arrays.equals(fullL, new long[] {
                                -7890300535592285273L,
                                6688032430344901361L,
                                -6778055975199832713L,
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.