Returns a new {@code ImageReader} that can read JPEG images.

@return a new {@code ImageReader} that can read JPEG images.
@throws IllegalStateException if no JPEG provider was found
@throws Error                 if the reader can't be instantiated
193188
ImageReader createJPEGReader() {
        maybeInitJPEGProvider();
        if (jpegProvider == null) {
            throw new IllegalStateException("No suitable JPEG reader provider found");
        }

        try {
            return jpegProvider.createReaderInstance();
        }
        catch (IOException e) {
            // NOTE: The default Sun version never throws IOException here
            throw new Error("Could not create JPEG reader: " + e.getMessage(), e);
        }
    }
1297674
public static BufferedImage read (ByteBuffer byteBuffer)
        throws IOException
    {
        // read in our integer fields
        IntBuffer ibuf = byteBuffer.asIntBuffer();
        int width = ibuf.get();
        int height = ibuf.get();
        /* int tpixel = */ ibuf.get();
        int msize = ibuf.get();

        if (width > Short.MAX_VALUE || width < 0 || height > Short.MAX_VALUE || height < 0) {
            throw new IOException("Bogus image size " + width + "x" + height);
        }

        IndexColorModel cmodel;
        synchronized (_origin) { // any old object will do
            // make sure our colormap array is big enough
            if  (_cmap == null || _cmap.length < msize) {
                _cmap = new int[msize];
            }
            // read in the data and create our colormap
            ibuf.get(_cmap, 0, msize);
            cmodel = new IndexColorModel(
                8, msize, _cmap, 0, DataBuffer.TYPE_BYTE, null);
        }

        // advance the byte buffer accordingly
        byteBuffer.position(ibuf.position() * 4);

        // read in the image data itself
        byte[] data = new byte[width*height];
        byteBuffer.get(data);

        // create the image from our component parts
        DataBuffer dbuf = new DataBufferByte(data, data.length, 0);
        int[] offsets = new int[] { 0 };
        PixelInterleavedSampleModel smodel =
            new PixelInterleavedSampleModel(
                DataBuffer.TYPE_BYTE, width, height, 1, width, offsets);
        WritableRaster raster = WritableRaster.createWritableRaster(smodel, dbuf, _origin);
        return new BufferedImage(cmodel, raster, false, null);
    }
58631
public BufferedImage getImage() {
        ByteBuffer artwork = getRawBytes();
        artwork.rewind();
        byte[] imageBytes = new byte[artwork.remaining()];
        artwork.get(imageBytes);
        try {
            return ImageIO.read(new ByteArrayInputStream(imageBytes));
        } catch (IOException e) {
            logger.error("Weird! Caught exception creating image from artwork bytes", e);
            return null;
        }
    }
1227337
public PackageDescr read(final Reader reader) throws SAXException,
                                                 IOException {
        this.packageDescr = (PackageDescr) this.parser.read( reader );
        return this.packageDescr;
    }
1303772
public Reader requestGet() throws IOException {

        connection.setRequestMethod("GET");
        connection.setDoOutput(false);

        return new Reader(connection.getInputStream());
    }
1126968
public Class getNewClass() throws IllegalStateException, ClassFormatError {
        if (mClass != null) {
            return mClass;
        }
        ByteArrayOutputStream data = mData;
        if (data == null) {
            throw new IllegalStateException("Class not defined yet");
        }

        byte[] bytes = data.toByteArray();

        if (DEBUG) {
            File file = new File(mName.replace('.', '/') + ".class");
            try {
                File tempDir = new File(System.getProperty("java.io.tmpdir"));
                file = new File(tempDir, file.getPath());
            } catch (SecurityException e) {
            }
            try {
                file.getParentFile().mkdirs();
                System.out.println("ClassInjector writing to " + file);
                OutputStream out = new FileOutputStream(file);
                out.write(bytes);
                out.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        mClass = mLoader.define(mName, bytes);
        mData = null;
        return mClass;
    }
718917
public static Reader reader(File file) {
        E.illegalArgumentIfNot(file.canRead(), "file not readable: " + file.getPath());
        try {
            return new FileReader(file);
        } catch (IOException e) {
            throw E.ioException(e);
        }
    }
616913
public byte[] asByteArray() throws IOException {
		if (reader != null) {
			throw new IllegalStateException("Cannot get raw bytes from a Reader object.");
		}

		InputStream in = buildInputStream();
		return consumeInputStream(in);
	}
372748
public static String getImageFormat(ImageInputStream input) {
        Iterator<ImageReader> readers = ImageIO.getImageReaders(input);
        String format = "unknown";
        if (readers.hasNext()) {
            ImageReader reader = readers.next();
            try {
                format = reader.getFormatName();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                reader.dispose();
            }
        }

        return format;
    }
721571
public static BufferedImage read(URL imageUrl) {
		try {
			return ImageIO.read(imageUrl);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
1219851
@Override
    public ImageHeader readHeader(InputStream input) throws IOException
    {
        final int toSkip = 3 + 15;
        long skipped = input.skip(toSkip);
        checkSkippedError(skipped, toSkip);
        final int width = readInt(input, 2, true);
        skipped = input.skip(2);
        checkSkippedError(skipped, 2);
        final int height = readInt(input, 2, true);
        final ImageFormat format = ImageFormat.PNG;

        return new ImageHeaderModel(width, height, format);
    }
1065310
public ISimpleChemObjectReader createReader(Reader input) throws IOException {
        if (!(input instanceof BufferedReader)) {
            input = new BufferedReader(input);
        }
        IChemFormat chemFormat = formatFactory.guessFormat((BufferedReader) input);
        ISimpleChemObjectReader coReader = createReader(chemFormat);
        try {
            coReader.setReader(input);
        } catch (Exception exception) {
            logger.error("Could not set the Reader source: ", exception.getMessage());
            logger.debug(exception);
        }
        return coReader;
    }
705392
public CifarRaw readImage() throws IOException {

    int label = readUnsignedByte(); // peel off the first byte which is the image label

    int[][] red = new int[getRows()][getCols()];
    for (int i = 0; i < getCols(); i++) {
      for (int j = 0; j < getRows(); j++) {
        red[i][j] = readUnsignedByte();
      }
    }

    int[][] green = new int[getRows()][getCols()];
    for (int i = 0; i < getCols(); i++) {
      for (int j = 0; j < getRows(); j++) {
        green[i][j] = readUnsignedByte();
      }
    }

    int[][] blue = new int[getRows()][getCols()];
    for (int i = 0; i < getCols(); i++) {
      for (int j = 0; j < getRows(); j++) {
        blue[i][j] = readUnsignedByte();
      }
    }
    return new CifarRaw(label, red, green, blue);
  }
488374
public static ImageLoader getLoader(Context context) {
        ImageLoader loader = (ImageLoader) context.getApplicationContext().getSystemService(IMAGE_LOADER_SERVICE);
        if (loader == null) {
            throw new IllegalStateException("ImageLoaderApplication not set as application class in" +
                    "AndroidManifest.xml");
        } else {
            return loader;
        }
    }
1317612
public static BufferedReader newReader(Path self) throws IOException {
        return Files.newBufferedReader(self, Charset.defaultCharset());
    }
1249085
public <T> T read(final Reader reader, final DataTypeDescriptor<T> descriptor) {
		try {
			return jsonFormat.read(reader, descriptor);
		} catch (Exception e) {
			throw propagate(e);
		}
	}
415636
public ServletInputStream getInputStream()
    {
        if (_inputState!=0 && _inputState!=1)
            throw new IllegalStateException();
        if (_in==null)
            _in = new ServletIn((HttpInputStream)_httpRequest.getInputStream());  
        _inputState=1;
        _reader=null;
        return _in;
    }