ftp.nice.ch/pub/next/system/patches/Rtf_compiler.N.bs.tar.gz#/Rtf_compiler/VYNXStreamObject.m

This is VYNXStreamObject.m in view mode; [Download] [Up]

{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Ohlfs;}
\paperw13300
\paperh12580
\margl120
\margr120
{\colortbl;\red80\green80\blue80;\red0\green0\blue0;\red255\green0\blue0;\red51\green51\blue51;\red49\green49\blue49;\red48\green48\blue48;\red47\green47\blue47;}
\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 //by Charles Lloyd\
\

\gray333\fc1\cf1 #import "VYNXStreamObject.h"\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\gray333\fc0\cf0 #import "VYStringFamily.h"
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \
\
///////////////////////////////////////////////////////////////////////////////\

\fc2\cf2 //
\b\fs48 	VYNXStreamObject
\b0\fs28\fc0\cf0 \
///////////////////////////////////////////////////////////////////////////////\

\gray333\fc1\cf1 @implementation
\gray0\fc0\cf0  VYNXStreamObject\
\

\i\gray333 //This is a wrapper for the NXStream functions and extends the NXStream functionality into some higher level routines which allow a user to access a stream somewhat like an array.  NOTE:  You should never alloc/init an NXStreamObject because this is an abstract class.  Use a subclass of this class.\

\i0\gray0 \

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\gray333\fc0\cf0 ////////////////////////////////////////////////////////////////\
//		Stream family supporting functions\
////////////////////////////////////////////////////////////////
\gray0 \
\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 void
\b  objectPrintf
\b0 (NXStream *
\i anNXStream
\i0 , void *
\i anObject
\i0 , void *
\i procData
\i0 )\
\{\
//
{{\NeXTHelpLink855 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXPrintf(
\i anNXStream
\i0 , "%s", [(id)
\i anObject
\i0  stringValue]);\
return;\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \}\

\gray333 \
////////////////////////////////////////////////////////////////\
//		Class methods\
////////////////////////////////////////////////////////////////
\gray0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \

\fs20 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 +
\b initialize
\b0 \
\{\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 if(!(self == [VYNXStreamObject class]))\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 return self;\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 [self registerPrintfProc:objectPrintf forCharacter:'Z' procData:NULL];\
return self;\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \}\
\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\fs28 +
\b registerPrintfProc:
\b0 (NXPrintfProc *)
\i printfProc
\i0  
\b forCharacter:(
\b0 char)
\i formatChar
\i0  
\b procData:
\b0 (void *)
\i procData
\i0 \
\{\
//
{{\NeXTHelpLink1368 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXRegisterPrintfProc;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXRegisterPrintfProc(
\i formatChar
\i0 , 
\i printfProc
\i0 , 
\i procData
\i0 );\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\gray333\fc0\cf0 ////////////////////////////////////////////////////////////////\
//		Init/Close methods\
////////////////////////////////////////////////////////////////
\gray0 \
\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\b initStream:
\b0 (NXStream*)
\i anExistingStream
\i0 \
\{\

\i\gray333 //Sets the instance variable nxStream to anExistingStream.  \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc0\cf0 [super init];\
nxStream = 
\i anExistingStream
\i0 ;\
return self;\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \}\
\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\b\fs28\fc0\cf0 -free
\b0 \
\{\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 [self close];\
return [super free];\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \}\
\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\b\fs28\fc0\cf0 -freeButLeaveStream
\b0 \
\{\

\gray300\fc3\cf3 //THIS SHOULD BE IMPLEMENTED AS A DIFFERNT CLASS EQUIVALENT TO STRINGPTR.  I NEED A STREAMPTR CLASS AS WELL.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return [super free];\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \}\
\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 close\

\b0 \{\

\i\gray333 //
{\i0\gray0{\NeXTHelpLink2038 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXClose;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i\ulnone\fs28\fi-180\li180\gray333\fc0\cf0 Currently, close is left as subclassResponsibility because it seems that each type of stream requires a little different activity on close.  I wanted to make sure this does not simply execute NXClose and give the user a false sense of security.  I will (soon) implement the various default close methods for the stream classes.\

\i0\gray0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXClose(nxStream);\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 changeBuffer
\b0 \
\{\
//
{{\NeXTHelpLink2438 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXStreamCreateFromZone;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 switch(nxStream->flags)\{\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 case NX_READFLAG:\

\pard\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li2160\fc0\cf0 nxStream->flags = NX_WRITEFLAG;\
break;\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 case NX_WRITEFLAG:\

\pard\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li2160\fc0\cf0 nxStream->flags = NX_READFLAG;\
break;\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 default:\

\pard\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li2160\fc0\cf0 break;\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 \}\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (NXStream*)
\b stream\

\b0 \{\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return nxStream;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b read:
\b0 (void *)
\i buffer
\i0  
\b count:
\b0 (int)
\i count
\i0 \
\{\

\i\gray333 //
{{\NeXTHelpLink2735 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXRead;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i\ulnone\fs28\fi-180\li180\gray333\fc0\cf0 This private method allow readCount: to be written abstractly.  Since user-defined streams use a different function to implemet readCount: this is broken out so it can be overridden by UserDefinedNXStreamObject stream class.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc0\cf0 return NXRead(nxStream, 
\i buffer
\i0 , 
\i count
\i0 );\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 readCount:
\b0 (int)
\i count
\b\i0 \

\b0 \{\

\i\gray333 //This creates a VoidBuffer large enough to hold count bytes and reads the stream from the current position into that object.  This returns the VoidBuffer created.  The caller of this method must free the resulting VoidBuffer object.  Also, the caller should check to see if the count of the resulting VoidBuffer is what was expected; if not, an error may have occured (or EOS may have been reached).\

\i0\gray0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 id aVoidBuffer;\
int actualCountRead;\
\

\i\gray333 //this usage of VoidBuffer is somewhat illegal because I am initializing the contents of the VoidBuffer externally rahter than letting the VoidBuffer do it.  That's the nature of object wrappers for C functions, though.\

\i0\gray0 aVoidBuffer = [[VYVoidBuffer alloc] initBuffSize:
\i count
\i0 ];\
actualCountRead = [self  read: (void*)[aVoidBuffer voidPtr] count:
\i count
\i0 ];\
[aVoidBuffer setCount:(unsigned)actualCountRead];\
return aVoidBuffer;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 readAll
\b0 \
\{\

\i\gray333 //Determines the size of the stream and calls readCount to create a VoidBuffer with all the stream's contents in it.  NOTE:  This is implemented using low-level methods for convenience sake.  Need to go back and replace these with NX functions for performance.  This modifies the position of the stream.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc0\cf0 long streamSize;\
id aVoidBuffer;\
\
[self seekToEnd];\
streamSize = [self tell];\
[self seekToStart];\
aVoidBuffer = [self readCount:streamSize];\
return aVoidBuffer;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b write:
\b0 aVoidPtr 
\b count:
\b0 (int)
\i count
\b\i0 \

\b0 \{\

\i\gray333 //
{{\NeXTHelpLink4464 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXRead;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i\ulnone\fs28\fi-180\li180\gray333\fc0\cf0 This returns the number of bytes actually written.  The calling routine should decide what this value means.  aVoidPtr is an instance of VoidPtr or one of its subclasses.  If the caller specifies a count of 0, then this will write the entire voidPtr.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc0\cf0 int bytesToWrite = count ? count : [aVoidPtr count];\
return NXWrite(nxStream, [aVoidPtr voidPtr], bytesToWrite);\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b putc:
\b0 (char)
\i aChar
\b\i0 \

\b0 \{\
//
{{\NeXTHelpLink4876 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return NXPutc(nxStream, 
\i aChar
\i0 );\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b getc\

\b0 \{\
//
{{\NeXTHelpLink4945 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return NXGetc(nxStream);\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (void)
\b ungetc\

\b0 \{\
//
{{\NeXTHelpLink5010 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXUngetc(nxStream);\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 scanf:
\b0 (const char *)
\i formatStr
\i0 ,...
\b \

\b0 \{\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i\fi-540\li1080\gray333\fc0\cf0 //
{\i0\gray0{\NeXTHelpLink5091 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\f0\b0\i\ulnone\fs28\fi-540\li1080\gray333\fc0\cf0 not currently supported; if you need this functionality, let me know and I'll implement this for you.  In the mean time, use the 
\b stream
\b0  methd and call NXScanf directly.\
\

\i0\gray0 return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 printf:
\b0 (const char *)
\i formatStr
\i0 ,...\
\{\
//
{{\NeXTHelpLink5335 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 va_list  arg_list;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 va_start(arg_list, 
\i formatStr
\i0 );\
NXVPrintf(nxStream
\b , 
\b0\i formatStr
\i0 , arg
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0\cf0 _list
\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 );\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 vprintf:
\b0 (const char *)
\i formatStr
\i0  
\b argList:
\b0 (va_list)
\i argList
\i0 \
\{\
//
{{\NeXTHelpLink5525 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXVPrintf(nxStream, 
\i formatStr
\i0 , 
\i argList
\i0 );\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b flush\

\b0 \{\
//
{{\NeXTHelpLink5617 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXFlush;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return NXFlush(nxStream);\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 seekToStart
\b0 \
\{\
//
{{\NeXTHelpLink5682 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXSeek(nxStream, 0L, NX_FROMSTART);\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 seekToEnd
\b0 \
\{\
//
{{\NeXTHelpLink5768 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXSeek(nxStream, 0L, NX_FROMEND);\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 seekFromStart:
\b0 (long)
\i offset
\i0 \
\{\
//
{{\NeXTHelpLink5869 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXSeek(nxStream, offset, NX_FROMSTART);\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 seekFromCurrent:
\b0 (long)
\i offset
\i0 \
\{\
//
{{\NeXTHelpLink5978 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXSeek(nxStream, offset, NX_FROMCURRENT);\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 seekFromEnd:
\b0 (long)
\i offset
\i0 \
\{\
//
{{\NeXTHelpLink6085 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 NXSeek(nxStream, offset, NX_FROMEND);\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (long)
\b tell\

\b0 \{\
//
{{\NeXTHelpLink6174 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return NXTell(nxStream);\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (BOOL)
\b atEOS
\b0 \
\{\
//
{{\NeXTHelpLink6238 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return (NXAtEOS(nxStream)) ? YES : NO;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b saveToFile:
\b0\i fullPathName\

\i0 \{\
//
{\i\gray333{\NeXTHelpLink6333 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXOpenMemory;}
¬}\pard\tx720\tx5060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-180\li180\fc0\cf0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return NXSaveToFile(nxStream, [fullPathName stringValue]);\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\gray333 /////////////////////////////////////////////////\
// higher level methods\
/////////////////////////////////////////////////\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 (int)
\b findCharacter:
\b0 (char)
\i goal\

\i0 \{\

\i\gray333 //returns the offset of the character goal from the current position in the stream or 0 if not found. The stream is positioned at the next occurence of the character "goal".  Use NXAtEOS() to detect if the character is not found; a return value of zero (0) alone is not enough to tell that the character was not found.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc0\cf0 \
int currentOffset=0;\
\
while(!(NXAtEOS(nxStream)))\{	//
{{\NeXTHelpLink6945 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-540\li1080\fc0\cf0 \

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 if(NXGetc(nxStream) == goal)\{	//
{{\NeXTHelpLink6979 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-540\li1620\fc0\cf0 \

\pard\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li2160\fc0\cf0 NXUngetc(nxStream);	//
{{\NeXTHelpLink7003 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXPutc;}
¬}\pard\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-540\li2160\fc0\cf0 \
return currentOffset;\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 \}\
currentOffset++;\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 \}\
return 0;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 getNextLine\

\b0 \{\

\i\gray333 //returns a StringBuffer containing the next line in the stream of nil if at eos.  This starts at the current position in the stream and retrieves all the characters in the stream up to the nex newline.  The stream is left positioned at the first character after the new line.  If eos is encountered before a newline, a newline is not added to the stringbuffer being returned.\

\i0\gray0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 int offset;\
id voidBuffer;\
\
offset = [self findCharacter:'\\n'];\

\pard\tx1620\tx2160\tx2700\tx3240\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 if(NXAtEOS(nxStream))	//
{{\NeXTHelpLink7559 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx1620\tx2160\tx2700\tx3240\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-540\li1080\fc0\cf0 \

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 return nil;\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 [self seekFromCurrent:-offset];\
voidBuffer = [self readCount:(offset+1)]; //voidBuffer is created by this method.\
return [voidBuffer becomeStringBuffer];  //voidBuffer is freed by this method\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fc0\cf0 \

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fs20\fi-180\li180\fc0\cf0 //NXStreamObject\

\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fs28\fc0\cf0 -
\pard\tx720\tx5060\tx9200\tx10360\tx11520\b\fi-180\li180\fc0\cf0 lineAt:
\b0 (int)
\i lineNumber\

\i0 \{\

\i\gray333 //modifies stream position.  Starts at beginning of stream, searches repeatedly for newline thereby positioning the stream properly. Once the line is found, returns the next line as a StringBuffer object.  Since this calls nextLine, it returns a StringBuffer object which the calling object must take responsibility for freeing.\

\i0\gray0 \

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 int i;\
\
[self seekToStart];\
for(i=0; i<lineNumber; i++)\{\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 if(!([self findCharacter:'\\n']) && (NXAtEOS(nxStream)))	//
{{\NeXTHelpLink8256 \markername ;\linkFilename StreamBundleHelp.rtf;\linkMarkername NXSeek;}
¬}\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fi-540\li1620\fc0\cf0 \

\pard\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li2160\fc0\cf0 return nil;\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 [self seekFromCurrent:1];\
\}\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 return [self getNextLine];\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\fs20 //NXStreamObject\

\fs28 -(BOOL)
\b containsRichText
\b0 \
\{\

\i\gray333\fc4\cf4 //Clean this up and make more OO.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc0\cf0 char buff[6], *rtfStr="\{\\\\rtf";\
int i;\
\
for(i=0; i<5; i++)\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 buff[i] = NXGetc(nxStream);\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 buff[5]='\\0';\
NXSeek(nxStream, 0L, NX_FROMSTART);\
if(strcmp(buff, rtfStr)==0)\

\pard\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1620\fc0\cf0 return YES;
\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\fc0\cf0 \
return NO;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\fs20 //NXStreamObject\

\b\fs28 -getMemoryBuffer
\b0 \
\{\

\i\gray333\fc5\cf5 //Prints the contents of the stream to aFileStream.  aFileStream may be something like stdout to make it go to the terminal which allows for redirection.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\gray333\fc5\cf5 //Prints the stringValue to 
\gray0\fc0\cf0 aFileStream
\gray333\fc5\cf5 .\

\i0\gray0\fc0\cf0 return [self readAll];\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\fs20 //NXStreamObject\

\b\fs28 -printOn:
\b0 (FILE*)
\i aFileStream
\i0 \
\{\

\i\gray333\fc5\cf5 //Prints the contents of the stream to aFileStream.  aFileStream may be something like stdout to make it go to the terminal which allows for redirection.\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\fi-540\li1080\gray333\fc5\cf5 //Prints the stringValue to 
\gray0\fc0\cf0 aFileStream
\gray333\fc5\cf5 .\

\i0\gray0\fc0\cf0 id aVoidBuffer = [self getMemoryBuffer];\
fprintf(
\i aFileStream
\i0 , "%s", (char*)[aVoidBuffer voidPtr]);\
[aVoidBuffer free];\
return self;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\fs20 //NXStreamObject\

\b\fs28 -
\b0 (BOOL)
\b isReadOnly
\b0 \
\{\

\i\gray333\fc6\cf6 //Ther is a pretty good chance this is not correct\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc2\cf2 return (nxStream->flags & NX_READFLAG) ? YES : NO;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\fs20 //NXStreamObject\

\b\fs28 -
\b0 (BOOL)
\b isWriteOnly
\b0 \
\{\

\i\gray333\fc7\cf7 //Ther is a pretty good chance this is not correct\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc2\cf2 return (nxStream->flags & NX_WRITEFLAG) ? YES : NO;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\fs20 //NXStreamObject\

\b\fs28 -
\b0 (BOOL)
\b isReadWrite
\b0 \
\{\

\i\gray333\fc7\cf7 //Ther is a pretty good chance this is not correct\

\pard\tx1620\tx2160\tx2700\tx3240\tx3780\tx9200\tx10360\tx11520\i0\fi-540\li1080\fc2\cf2 return (nxStream->flags & NX_READWRITE) ? YES : NO;\

\pard\tx720\tx5060\tx9200\tx10360\tx11520\fi-180\li180\fc0\cf0 \}\
\

\gray333\fc4\cf4 @end
\gray0\fc0\cf0 \

}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.