Java IO Package: Convert byte[] data array to InputStream
If you want to make InputStream using data array of bytes like byte [], you can use following,
Let's suppose your file data is copied in following byte array.
byte [] newImageData contains all data which have been read from some file.
InputStream inputStream = new ByteArrayInputStream(newImageData);
Let's suppose your file data is copied in following byte array.
byte [] newImageData contains all data which have been read from some file.
InputStream inputStream = new ByteArrayInputStream(newImageData);
Comments
Post a Comment