Create RandomAccessFile from InputStream??

B

bo_kid

Hello,

I wonder if there's any way to create a RandomAccessFile from an
InputStream?

The reason is that I'm porting an application to an applet and the
application opens a file on the file system as a RandomAccessFile.
I'm thinking of letting the applet fetch this file over a
HttpURLConnection, and this connection can only give me a InputStream.

Thanks in advance for any hints or info!
/Kid
 
A

Andrey Kuznetsov

I wonder if there's any way to create a RandomAccessFile from an
InputStream?

Use Unified I/O (http://uio.imagero.com)

Instead of RandomAccessFile you create RandomAccessRO or RandomAccess.

RandomAccessRO / RandomAccess have quite the same methods as
RandomAccessFile,
but can also read data from/into primitive arrays.
The reason is that I'm porting an application to an applet and the
application opens a file on the file system as a RandomAccessFile.
I'm thinking of letting the applet fetch this file over a
HttpURLConnection, and this connection can only give me a InputStream.

RandomAccessFactory.createRO(InputStream in);
RandomAccessFactory.createRO(java.net.URL url);
The second one is _very_ useful if you want to read just a part of url
content (for example header of 20MB image)
 
B

bo_kid

I was just wondering how the BSD license works! ;)

Not the right newsgroup to ask, but you Andrey seems to know:

Was does the license mean?
Can I distribute Java-software using Unified I/O freely?
Even if I'm making a profit of my Java-software?
The license says:

"Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution."

Does this mean I have to license my Java-soft under BSD also (and make
it "free")? Or I just have to include the BSD license text somewhere in
my Java-software saying that the unified I/O stuff is under BSD but my
software is not?

Appreciate if someone could explain these law/license stuff.
Best Regards,
/Bo
 
A

Andrey Kuznetsov

Not the right newsgroup to ask, but you Andrey seems to know:

Was does the license mean?
Can I distribute Java-software using Unified I/O freely?
Even if I'm making a profit of my Java-software?
The license says:

"Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution."

Does this mean I have to license my Java-soft under BSD also (and make
it "free")? Or I just have to include the BSD license text somewhere in
my Java-software saying that the unified I/O stuff is under BSD but my
software is not?
you should include BSD license for UIO and your own license for your stuff.
 
B

bo_kid

So using UIO doesn't automatically make my soft BSD licensed!

Thanks for all your help and information.

Have a nice weekend!
/Kid
 
T

Tilman Bohn

In message <[email protected]>,
So using UIO doesn't automatically make my soft BSD licensed!

This is getting off-topic, and it may be a fine point, and IANAL, but as
I understand it, using code under _any_ license doesn't magically change
the license you use for your own code. You may or may not violate the
other license by licensing your code in some particular way, but you are
the only one who can actually change the license on your code. (Have I
used the words `code' and `license' enough? ;-) )
 
B

bo_kid

Tilman,
Thanks for making it clear, I think. Not sure that I understand all of
it!?
But as you stated, we're getting off-topic. :)

By the way, what does IANAL mean?

Cheers,
/Kid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,201
Latest member
KourtneyBe

Latest Threads

Top