On 10/15/2012 2:08 PM, bob smith wrote:
> Let's say you have a function that plays a movie that
> is passed in as a FileDescriptor.
Okay: "You have a function that ..."
Why would you want to write such a method? As I understand
the Javadoc, the method could only get at the bytes behind the
FileDescriptor by constructing a FileInputStream from it, then
reading the FileInputStream. Why not have the method take a
FileInputStream in the first place? Better yet, why not have
it take an InputStream, and not insist on the "file" part?
> Is there any way to load the movie into RAM and get a
> FileDescriptor for the RAM?
Probably not. A method that took an InputStream could,
of course, be given a ByteArrayInputStream -- but if you're
dead-set on using FileDescriptor, I think you're out of luck.
--
Eric Sosman
d