how to create RandomAccessFile from InputStream?
Question
The only way I know is to write a temp file, and read this file to create RandomAccessFile ,check it here
or use Use Unified I/O library (http://uio.imagero.com) here
Would this be the best way? Or can use temp file and the imageio library to implement it?
Solution
Yes, for random access of an InputStream you must buffer the stream (at least up to the point requested). A library like Unified I/O should work, or you can implement DataInput and DataOutput, which will have your class operating like a RandomAccessFile except for the file part if you have custom buffering needs.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow