Package javax.imageio.stream.ImageInputStreamImplTest

Examples of javax.imageio.stream.ImageInputStreamImplTest.BasicImageInputStreamImpl.readFully()


    final BasicImageOutputStreamImpl out = new BasicImageOutputStreamImpl(
        2 * buff.length);
    final ImageInputStream in = new BasicImageInputStreamImpl(out.buff);

    out.writeChars("test");
    in.readFully(buff, 0, 4);
    assertEquals("test", new String(buff));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
View Full Code Here


    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    in.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    out.writeChars("test");
    in.readFully(buff, 0, 4);
    assertEquals("test", new String(buff));

    out.reset();
    in.reset();
    out.writeChars(" test".toCharArray(), 1, 4);
View Full Code Here

    assertEquals("test", new String(buff));

    out.reset();
    in.reset();
    out.writeChars(" test".toCharArray(), 1, 4);
    in.readFully(buff, 0, 4);
    assertEquals("test", new String(buff));
  }

  public void testWriteShorts() throws IOException {
    final short[] src = new short[] { 1, 2, 3 };
View Full Code Here

    final BasicImageOutputStreamImpl out = new BasicImageOutputStreamImpl(
        2 * dest.length);
    final ImageInputStream in = new BasicImageInputStreamImpl(out.buff);

    out.writeShorts(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
View Full Code Here

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    in.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    out.writeShorts(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));
  }

  public void testWriteInts() throws IOException {
    final int[] src = new int[] { 1, 2, 3 };
View Full Code Here

    final BasicImageOutputStreamImpl out = new BasicImageOutputStreamImpl(
        4 * dest.length);
    final ImageInputStream in = new BasicImageInputStreamImpl(out.buff);

    out.writeInts(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
View Full Code Here

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    in.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    out.writeInts(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));
  }

  public void testWriteLongs() throws IOException {
    final long[] src = new long[] { 1, 2, 3 };
View Full Code Here

    final BasicImageOutputStreamImpl out = new BasicImageOutputStreamImpl(
        8 * dest.length);
    final ImageInputStream in = new BasicImageInputStreamImpl(out.buff);

    out.writeLongs(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
View Full Code Here

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    in.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    out.writeLongs(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));
  }

  public void testWriteFloats() throws IOException {
    final float[] src = new float[] { 1, 2, 3 };
View Full Code Here

    final BasicImageOutputStreamImpl out = new BasicImageOutputStreamImpl(
        4 * dest.length);
    final ImageInputStream in = new BasicImageInputStreamImpl(out.buff);

    out.writeFloats(src, 0, 3);
    in.readFully(dest, 0, 3);
    assertTrue(Arrays.equals(src, dest));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
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.