• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reading NSData from a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading NSData from a file


  • Subject: Re: Reading NSData from a file
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 2 Apr 2007 21:31:24 -0700


On Apr 2, 2007, at 9:13 PM, Janine Sisk wrote:

I'm trying to read a file into a variable of type NSData. According to the docs on NSData I should be able to use this:

public NSData(InputStream inputStream, int chunkSize)
       throws IOException

FileInputStream is a subclass of InputStream, so I tried this:

FileInputStream fileInputStream = new FileInputStream("/tmp/ WOtmpfile");
NSData imageThumbData = NSData(fileInputStream, 1000);


(values just for mucking around purposes)

But it doesn't take it - says the method NSData (FileInputStream,int) is undefined.

And it is true too! You forgot to say please, er new:

NSData imageThumbData = new NSData(fileInputStream, 1000);


What I'm trying to do here is to read back in the results of having run convert on an uploaded image file and making a thumbnail from it. The files are being written only for the convenience of convert, so if I could get out of writing them that would be all the better.

What are you using to convert it? AWT is not too bad for a Java solution.


Chuck


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Reading NSData from a file
      • From: Mike Schrag <email@hidden>
References: 
 >Reading NSData from a file (From: Janine Sisk <email@hidden>)

  • Prev by Date: Reading NSData from a file
  • Next by Date: Re: Reading NSData from a file
  • Previous by thread: Reading NSData from a file
  • Next by thread: Re: Reading NSData from a file
  • Index(es):
    • Date
    • Thread