Package javax.imageio.stream

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


                        break;
                    }
                    case 14: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE);
                        final byte[] expected = new byte[length]; r.readFully(expected);
                        final byte[] actual   = new byte[length]; t.readFully(actual);
                        assertArrayEquals("readFully(byte[])", expected, actual);
                        break;
                    }
                    case 15: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Character.SIZE);
View Full Code Here


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

                        break;
                    }
                    case 16: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Short.SIZE);
                        final short[] expected = new short[length]; r.readFully(expected, 0, length);
                        final short[] actual   = new short[length]; t.readFully(actual,   0, length);
                        assertArrayEquals("readFully(short[])", expected, actual);
                        break;
                    }
                    case 17: {
                        final int length = random.nextInt(ARRAY_MAX_SIZE * Byte.SIZE / Integer.SIZE);
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[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

  }

  stream.reset();
  stream.mark();
        byte[] b = new byte[12];
        stream.readFully(b);
        stream.reset();

        //Verify the signature box

        // The length of the signature box is 12
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.