I have a function, int readFully(FileHandle handle, OutputStream out)
, which reads in an entire file from an SSH server and stores it in a local stream. I can write the file locally by using a FileOutputStream
for the second parameter and then read that file into a BufferedImage
using something like this:
bufferedImage = ImageIO.read(new File("/path/to/file"));
But how can I create the bufferedImage directly without first writing it to a file? I looked at this question, but still can't figure it out for my case.