Package javax.imageio.stream

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


                                -6778055975199832713L,
                              }));

        short[] fullS = new short[32];
        i.seek(0);
        i.readFully(fullS, 0, 32);

        h.check(Arrays.equals(fullS, new short[] {
                                -28032,
                                1399,
                                -21262,
View Full Code Here


                        break;
                    }
                    case 17: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Integer.SIZE);
                        final int[] expected = new int[length]; r.readFully(expected, 0, length);
                        final int[] actual   = new int[length]; t.readFully(actual,   0, length);
                        assertArrayEquals("readFully(int[])", expected, actual);
                        break;
                    }
                    case 18: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Long.SIZE);
View Full Code Here

                        break;
                    }
                    case 18: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Long.SIZE);
                        final long[] expected = new long[length]; r.readFully(expected, 0, length);
                        final long[] actual   = new long[length]; t.readFully(actual,   0, length);
                        assertArrayEquals("readFully(long[])", expected, actual);
                        break;
                    }
                    case 19: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Float.SIZE);
View Full Code Here

                        break;
                    }
                    case 19: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Float.SIZE);
                        final float[] expected = new float[length]; r.readFully(expected, 0, length);
                        final float[] actual   = new float[length]; t.readFully(actual,   0, length);
                        assertTrue("readFully(float[])", Arrays.equals(expected, actual));
                        break;
                    }
                    case 20: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Double.SIZE);
View Full Code Here

                        break;
                    }
                    case 20: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Double.SIZE);
                        final double[] expected = new double[length]; r.readFully(expected, 0, length);
                        final double[] actual   = new double[length]; t.readFully(actual,   0, length);
                        assertTrue("readFully(double[])", Arrays.equals(expected, actual));
                        break;
                    }
                    case 21: {
                        final long length = random.nextInt(ARRAY_MAX_SIZE);
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

        }

        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)source;
        byte[] b = new byte[2];
        stream.mark();
        stream.readFully(b);
        stream.reset();

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

        ImageInputStream stream = (ImageInputStream)source;
        byte[] b = new byte[3];

        stream.mark();
        stream.readFully(b);
        stream.reset();

        return ((b[0] == (byte)0) &&  // TypeField == 0
                b[1] == 0 && // FixHeaderField == 0xxx00000; not support ext header
                ((b[2] & 0x8f) != 0 || (b[2] & 0x7f) != 0))// First width byte
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.