Not sure what's wrong with your code, but I use this utility method
all the time:
public static NSData nsDataFromFile( String filePath ) throws
FileNotFoundException, IOException {
File theFile = new File( filePath );
return new NSData( new FileInputStream( theFile ), (int)
theFile.length() );
}
I use sips for making thumbnails.... fast and easy.
On Apr 3, 2007, at 12:13 AM, 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.
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.
Any suggestions?
thanks,
janine
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%
40mac.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]