Package javax.imageio.stream

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


            int pos = 0;
            try {
                iis.mark();
                do {
                    if (pos + 2 > length) {
                        iis.reset();
                        iis.mark();
                        pos = 0;
                    }
                    iis.readUnsignedShort();
                    pos += 2;
View Full Code Here


                    pos += 2;
                } while (--numReps >= 0);
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try { iis.reset(); } catch (IOException e) {}
            }
        }
    }

    private static class IISReadInt extends InputStreamTests {
View Full Code Here

            int pos = 0;
            try {
                iis.mark();
                do {
                    if (pos + 4 > length) {
                        iis.reset();
                        iis.mark();
                        pos = 0;
                    }
                    iis.readInt();
                    pos += 4;
View Full Code Here

                    pos += 4;
                } while (--numReps >= 0);
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try { iis.reset(); } catch (IOException e) {}
            }
        }
    }

    private static class IISReadUnsignedInt extends InputStreamTests {
View Full Code Here

            int pos = 0;
            try {
                iis.mark();
                do {
                    if (pos + 4 > length) {
                        iis.reset();
                        iis.mark();
                        pos = 0;
                    }
                    iis.readUnsignedInt();
                    pos += 4;
View Full Code Here

                    pos += 4;
                } while (--numReps >= 0);
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try { iis.reset(); } catch (IOException e) {}
            }
        }
    }

    private static class IISReadFloat extends InputStreamTests {
View Full Code Here

                if (stream != null) {
                    stream.mark();
                }
                canDecode = spi.canDecodeInput(input);
                if (stream != null) {
                    stream.reset();
                }

                return canDecode;
            } catch (IOException e) {
                return false;
View Full Code Here

        byte[] signature = new byte[8];
        markable.seek(0);

        int nBytes = markable.read(signature, 0, 8);
        if(nBytes != 8) markable.read(signature, nBytes, 8-nBytes);
        markable.reset();

        // PNG signature: 137 80 78 71 13 10 26 10
        return  (signature[0] & 0xFF) == 137 &&
                (signature[1] & 0xFF) == 80 &&
                (signature[2] & 0xFF) == 78 &&
View Full Code Here

            markable.mark();

            byte[] signature = new byte[3];
            markable.seek(0);
            markable.read(signature, 0, 3);
            markable.reset();

            if ((signature[0] & 0xFF) == 0xFF &&
                    (signature[1] & 0xFF) == JPEGConsts.SOI &&
                    (signature[2] & 0xFF) == 0xFF) { // JPEG
                return true;
View Full Code Here

                                }
                                iccStream.write(buf);
                            }
                        }
                    } finally {
                        in.reset();
                    }
                    in.skipBytes(reclen);
                    break;
                case APPE: //Adobe-specific (see 5116.DCT_Filter.pdf)
                    in.mark();
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.