I am reading an grayscale tiff image into inputstream using
InputStream is=objCMBObject.getDataStream();
bytes = IOUtils.toByteArray(is);
response.setContentType(mimeType);
OutputStream os = response.getOutputStream();
and writing this stream into applet .but now I want to convert this grayscale image to binary image before writing to the applet. I don't want to save the image in file. How to convert inputstream of grayscale to binary?
I can convert the image into binary if I have x,y coordinates but I don't know how to get it from inputstream. Please guide.