tags:

views:

47

answers:

1

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?

+1  A: 

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.

Peter DeWeese