Skip to content Skip to sidebar Skip to footer

How To Read Png Images Form Inputstream In Java

There are 2 applications. One application act as server and sends continuously screen shot of desktop by using the following code. Robot robot=new Robot(); OutputStream os; Buffer

Solution 1:

In client application, read the InputStream via Socket.getInputStream() method.

 BufferedInputStream in = new BufferedInputStream(socket.getInputStream());
 BufferedImage image = ImageIO.read(in);

Solution 2:

Android SDK does not support the method ImageIO.read(). Even if you can compile your code, your android application will get crashed and have error about missing libraries like this:

could not find method javax.imageio.imageio.read

What I suggest is using bitmapping instead of this...


Post a Comment for "How To Read Png Images Form Inputstream In Java"