============================================================================
 BinStream.txt
 Copyrite 2000, Discreet
 By Simon Feltman, simon@asylum-soft.com
 Asylum Software, http://www.asylum-soft.com
 The following methods are contained in the BinStream.dlx module.
----------------------------------------------------------------------------

BinStream fopen <String fileName> <String mode>
   Opens a file for reading or writing based on the mode parameter. This can
   either be "wb" for Writing Binary or "rb" for Reading Binary. The function 
   will return a BinStream value.

Boolean FClose <BinStream>
   Close a BinStream value. Returns True if it successfully closed the BinStream.

Boolean fseek <BinStream> <Integer> <#seek_set | #seek_cur | #seek_end>
   Move the file pointer to the specified location based off the seek parameter.
    #seek_set - base off start of file.
    #seek_cur - base off current position.
    #seek_end - base off end of file.

Integer ftell <BinStream>
   Returns the current file pointer position.

Boolean WriteByte <BinStream> <Integer>
   Writes a Integer to the file as one byte. Returns True if write was successfull.

Boolean WriteShort <BinStream> <Integer>
   Writes a Integer to the file as two bytes. Returns True if write was successfull.

Boolean WriteLong <BinStream> <Integer>
   Writes a Integer to the file as four bytes. Returns True if write was successfull.

Boolean WriteFloat <BinStream> <Float>
   Writes a Float to the file as four bytes. Returns True if write was successfull.

Boolean WriteString <BinStream> <String>
   Writes a string to the file. Returns True if write was successfull.

Integer ReadByte <BinStream>
   Read a one byte value and return as an Integer.

Integer ReadShort <BinStream>
   Read a two byte value and return as an Integer.

Integer ReadLong <BinStream>
   Read a four byte value and return as an Integer.

Float ReadFloat <BinStream>
   Read a four byte value and return as an Float.

String ReadString <BinStream>
   Read a string from the file.


Example:

f=fopen "c:\\test.bin" "wb"
WriteString f "String"
WriteByte f 64
WriteShort f 128
WriteLong f 256
WriteFloat f 512.0
WriteString f "gnirtS"
WriteLong f (ftell f)
fclose f

f=fopen "c:\\test.bin" "rb"
ReadString f
ReadByte f
ReadShort f
ReadLong f
ReadFloat f
ReadString f
ftell f
ReadLong f
fclose f
