memory stream syntax
memory stream syntax
- Subject: memory stream syntax
- From: Candide Kemmler <email@hidden>
- Date: Sat, 30 Jun 2001 01:09:54 +0200
hi !
First, sorry for posting yet another message today. I had trouble with
my mail client and messages seem to take forever to get to the list
(why?...), which is the reason why I rewrote a message I sent just
before...
But I might begin to have a clue as to how I could have similar access
to primitive types from a stream: i guess I could use stdio's functions,
which are available from ObjC since it's just an extension to standard
C, right ?
But then, I'd need to obtain the stream from the NSURL or NSURLHandle,
which doesn't seem possible. So I began to search the web for
information about how to create a stream out of a byte array. I found a
very neat page on gnu.org explaining everything about glibc, and I tried
the following snippet:
char *bp;
size_t size;
FILE *stream;
stream = open_memstream (&bp, &size);/* while ((ch = fgetc
(stream)) != EOF)
printf ("Got %c\n", ch);
fclose (stream); */
Problem is: open_memstream isn't available on macosx's standard C lib.
I'd like to know what precise version of the standard C lib is available
on MacOSX, and wether a more recent version of libc could be installed,
and how...
Now, better still, does somebody know how to create a stream out of a
byte array using MacOSX's standard C library. Or is there a way to
achieve this in Objective-C.
Thanks for your precious help,
Candide Kemmler