Package javax.imageio.stream

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


        }
       
        ImageInputStream stream = (ImageInputStream)input;
        byte[] b = new byte[6];
        stream.mark();
        stream.readFully(b);
        stream.reset();

        return b[0] == 'G' && b[1] == 'I' && b[2] == 'F' && b[3] == '8' &&
            (b[4] == '7' || b[4] == '9') && b[5] == 'a';
    }
View Full Code Here


        }

        ImageInputStream stream = (ImageInputStream)input;
        byte[] b = new byte[8];
        stream.mark();
        stream.readFully(b);
        stream.reset();
       
        return (b[0] == (byte)137 &&
                b[1] == (byte)80 &&
                b[2] == (byte)78 &&
View Full Code Here

        }

        ImageInputStream stream = (ImageInputStream)input;
        byte[] b = new byte[8];
        stream.mark();
        stream.readFully(b);
        stream.reset();

        return (b[0] == (byte)137 &&
                b[1] == (byte)80 &&
                b[2] == (byte)78 &&
View Full Code Here

        }

        ImageInputStream stream = (ImageInputStream)input;
        byte[] b = new byte[6];
        stream.mark();
        stream.readFully(b);
        stream.reset();

        return b[0] == 'G' && b[1] == 'I' && b[2] == 'F' && b[3] == '8' &&
            (b[4] == '7' || b[4] == '9') && b[5] == 'a';
    }
View Full Code Here

        }

        ImageInputStream stream = (ImageInputStream)source;
        byte[] b = new byte[2];
        stream.mark();
        stream.readFully(b);
        stream.reset();

        return (b[0] == 0x42) && (b[1] == 0x4d);
    }
View Full Code Here

                    in.mark();
                    try {
                        reclen = in.readUnsignedShort();
                        // 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"))) {
                            log.debug("JPEG has an ICC profile");
                            in.skipBytes(2); //chunk sequence number and total number of chunks
View Full Code Here

                                //ICC profiles can be split into several chunks
                                //so collect in a byte array output stream
                                iccStream = new ByteArrayOutputStream();
                            }
                            byte[] buf = new byte[reclen - 18];
                            in.readFully(buf);
                            iccStream.write(buf);
                        }
                    } finally {
                        in.reset();
                    }
View Full Code Here

                    in.mark();
                    try {
                        reclen = in.readUnsignedShort();
                        // 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

                    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

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.