Q:

Open a bitmap with Inputstream

How would I open a bitmap with Inputstream?
e.g InputStream inputStream = image where image is of type Bitmap?
Thanks.

A:

To read the bitmap image in your app,
BufferedImage img = ImageIO.load("mybitmap.bmp");
To get the pixels from the buffered image object, use getRGB()
int[] pixels = img.getRGB(0, 0, img.getWidth(), img.getHeight(), null, 0, img.getWidth());

javadoc for getRGB().
For more info, see this article.

