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


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

Re: RAM FileDescriptor

Received by 10.66.73.7 with SMTP id h7mr2888045pav.6.1350325633170; Mon, 15 Oct 2012 11:27:13 -0700 (PDT)
Received by 10.68.216.132 with SMTP id oq4mr2678553pbc.8.1350325633153; Mon, 15 Oct 2012 11:27:13 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!kr7no30629737pbb.0!news-out.google.com!jt13ni6326pbb.1!nntp.google.com!kr7no30629736pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Mon, 15 Oct 2012 11:27:13 -0700 (PDT)
In-Reply-To <f6d1d840-9769-447a-893e-f8cce07d2d23@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 69.28.149.29
References <f6d1d840-9769-447a-893e-f8cce07d2d23@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <5855dde7-ea94-46fb-a8aa-7012f29a9a88@googlegroups.com> (permalink)
Subject Re: RAM FileDescriptor
From Lew <lewbloch@gmail.com>
Injection-Date Mon, 15 Oct 2012 18:27:13 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:19369

Show key headers only | 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