Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19369

Re: RAM FileDescriptor

Newsgroups comp.lang.java.programmer
Date 2012-10-15 11:27 -0700
References <f6d1d840-9769-447a-893e-f8cce07d2d23@googlegroups.com>
Message-ID <5855dde7-ea94-46fb-a8aa-7012f29a9a88@googlegroups.com> (permalink)
Subject Re: RAM FileDescriptor
From Lew <lewbloch@gmail.com>

Show all headers | View raw


bob smith wrote:
> Let's say you have a function that plays a movie that is passed in as a FileDescriptor.  

That seems like a really bad way to pass in such a thing.

> Is there any way to load the movie into RAM and get a FileDescriptor for the RAM?

You really shouldn't use 'FileDescriptor'. Haven't others commented on this to you before?

"The main practical use for a file descriptor is to create a FileInputStream or FileOutputStream to contain it.
Applications should not create their own file descriptors."

So you want to ignore that advice why?

Anyway, to answer your question, you load it into RAM the same way you would any 
'FileInputStream'.

Create one around your 'FileDescriptor' and continue as you should have in the first place 
from the stream.

To put it another way, create the stream first, then pass it into your file handler routine.

 process( new FileInputStream( fileDescriptorIShouldNotHaveUsed ));

and thus

 public void process( InputStream input ) throws IOException { ... }

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RAM FileDescriptor bob smith <bob@coolfone.comze.com> - 2012-10-15 11:08 -0700
  Re: RAM FileDescriptor Lew <lewbloch@gmail.com> - 2012-10-15 11:27 -0700
  Re: RAM FileDescriptor Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-15 14:34 -0400
  Re: RAM FileDescriptor Jeff Higgins <jeff@invalid.invalid> - 2012-10-15 14:41 -0400
    Re: RAM FileDescriptor David Lamb <dalamb@cs.queensu.ca> - 2012-10-15 15:07 -0400
      Re: RAM FileDescriptor Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-10-15 12:59 -0700
        Re: RAM FileDescriptor Arne Vajhoej <arne@vajhoej.dk> - 2012-10-17 11:45 -0400
          Re: RAM FileDescriptor David Lamb <dalamb@cs.queensu.ca> - 2012-10-17 15:08 -0400
    Re: RAM FileDescriptor Jeff Higgins <jeff@invalid.invalid> - 2012-10-15 15:25 -0400
  Re: RAM FileDescriptor Jeff Higgins <jeff@invalid.invalid> - 2012-10-15 16:22 -0400
    Re: RAM FileDescriptor Jeff Higgins <jeff@invalid.invalid> - 2012-10-15 16:26 -0400
  Re: RAM FileDescriptor Jim Janney <jjanney@shell.xmission.com> - 2012-10-16 12:40 -0600
  Re: RAM FileDescriptor Arne Vajhoej <arne@vajhoej.dk> - 2012-10-17 11:43 -0400
  Re: RAM FileDescriptor Jan Burse <janburse@fastmail.fm> - 2012-10-17 17:55 +0200

csiph-web