/** * Skips "len" amount of bytes from the InputStream. If len is < 0, nothing is skipped. * * @param len amount of bytes needed to skip * @throws IOException */ public void skip(int len) throws IOException{ length += len; StreamUtil.skip(in, len); }
len = getShort(jpegStream); if (len < 16) { StreamUtil.skip(jpegStream, len - 2); continue; StreamUtil.skip(jpegStream, len - 2 - bcomp.length); continue; StreamUtil.skip(jpegStream, 2); int units = jpegStream.read(); int dx = getShort(jpegStream); image.setDpi((int) (dx * 2.54f + 0.5f), (int) (dy * 2.54f + 0.5f)); StreamUtil.skip(jpegStream, len - 2 - bcomp.length - 7); continue; int markertype = marker(marker); if (markertype == VALID_MARKER) { StreamUtil.skip(jpegStream, 2); if (jpegStream.read() != 0x08) { throw new IOException(IOException._1MustHave8BitsPerComponent).setMessageParams(errorID); throw new IOException(IOException._1UnsupportedJpegMarker2).setMessageParams(errorID, Integer.toString(marker)); } else if (markertype != NOPARAM_MARKER) { StreamUtil.skip(jpegStream, getShort(jpegStream) - 2);
len = getShort(jpegStream); if (len < 16) { StreamUtil.skip(jpegStream, len - 2); continue; StreamUtil.skip(jpegStream, len - 2 - bcomp.length); continue; StreamUtil.skip(jpegStream, 2); int units = jpegStream.read(); int dx = getShort(jpegStream); image.setDpi((int) (dx * 2.54f + 0.5f), (int) (dy * 2.54f + 0.5f)); StreamUtil.skip(jpegStream, len - 2 - bcomp.length - 7); continue; int markertype = marker(marker); if (markertype == VALID_MARKER) { StreamUtil.skip(jpegStream, 2); if (jpegStream.read() != 0x08) { throw new IOException(IOException._1MustHave8BitsPerComponent).setMessageParams(errorID); throw new IOException(IOException._1UnsupportedJpegMarker2).setMessageParams(errorID, Integer.toString(marker)); } else if (markertype != NOPARAM_MARKER) { StreamUtil.skip(jpegStream, getShort(jpegStream) - 2);
throw new IOException(IOException.ExpectedFtypMarker); StreamUtil.skip(jpeg2000Stream, 8); for (int i = 4; i < box.length / 4; ++i) { if (cio_read(4, jpeg2000Stream) == JPX_JPXB) { throw new IOException(IOException.ExpectedJp2hMarker); StreamUtil.skip(jpeg2000Stream, box.length - 8); jp2_read_boxhdr(box, jpeg2000Stream); jp2.parameters.numOfComps = cio_read(2, jpeg2000Stream); jp2.setBpc(cio_read(1, jpeg2000Stream)); StreamUtil.skip(jpeg2000Stream, 3); jp2_read_boxhdr(box, jpeg2000Stream); if (box.type == JP2_BPCC) { StreamUtil.skip(jpeg2000Stream, 4); int x1 = cio_read(4, jpeg2000Stream); int y1 = cio_read(4, jpeg2000Stream); int x0 = cio_read(4, jpeg2000Stream); int y0 = cio_read(4, jpeg2000Stream); StreamUtil.skip(jpeg2000Stream, 16); jp2.setColorSpace(cio_read(2, jpeg2000Stream)); jp2.setBpc(8);
throw new IOException(IOException.ExpectedFtypMarker); StreamUtil.skip(jpeg2000Stream, 8); for (int i = 4; i < box.length / 4; ++i) { if (cio_read(4, jpeg2000Stream) == JPX_JPXB) { throw new IOException(IOException.ExpectedJp2hMarker); StreamUtil.skip(jpeg2000Stream, box.length - 8); jp2_read_boxhdr(box, jpeg2000Stream); jp2.parameters.numOfComps = cio_read(2, jpeg2000Stream); jp2.setBpc(cio_read(1, jpeg2000Stream)); StreamUtil.skip(jpeg2000Stream, 3); jp2_read_boxhdr(box, jpeg2000Stream); if (box.type == JP2_BPCC) { StreamUtil.skip(jpeg2000Stream, 4); int x1 = cio_read(4, jpeg2000Stream); int y1 = cio_read(4, jpeg2000Stream); int x0 = cio_read(4, jpeg2000Stream); int y0 = cio_read(4, jpeg2000Stream); StreamUtil.skip(jpeg2000Stream, 16); jp2.setColorSpace(cio_read(2, jpeg2000Stream)); jp2.setBpc(8);