LongBinaryStream REALbasic Plugin

LongBinaryStream Class

LongBinaryStream is a class to handle binary files, LongBinaryStream can go over the 2GB limit on file systems that support larger than 2 GB files.

Object
   LongBinaryStream

class LongBinaryStream implements

IBinaryStreamReader

IBinaryStreamWriter

IBlockReader

IBlockWriter

Constructors

LongBinaryStreamThe default constructor for the LongBinaryStream, which takes a FolderItem and a Boolean parameter.
LongBinaryStreamUse this constructor to do optimized streaming based on shared memory blocks.

Properties

BufferThis property can be used to obtain or set the MemoryBlock that is used for a shared memory block based streaming.
FileRefNumThis property will return a FileRefNum to Old style MacOS file API if SupportsLongFiles = false, it will return a FileRefNum to the new MacOS file API if SupportsLongFiles = true. On windows it will always return a reference to a Handle (File Handle) The Purpose of this property is to allow people to extend the class with API calls.
LengthThis property will return the length of the Stream.
PositionUse this property to set or get the position of the file cursor within the stream.
SupportsLongFilesThis property will return true if the System on the running computer supports files larger than 2 GB, if it does not then the LongBinaryStream will automatically switch to old style API internally.

Methods

BindTo bind the stream to a IBlockWriter stream then use the Bind method.
CloseUse this method to close the stream.
EOFThis function will return true when the end of the file has been reached when reading from a file.
LastErrorThis function will return the number of last error, 0 = no error.
ProcessBoundBlockUse the ProcessBoundBlock in a loop to stream between two streams that have been bound together with the Bind method.
ReadUse this function to read data from the stream.
ReadBlockCall the ReadBlock function in a loop to let the stream read data from a shared memory block.
ReadByteUse this function to read a single byte as Integer from the stream.
ReadLongUse this function to read a long integer value into a REALbasic integer variable.
ReadPStringUse this function to read a Pascal string from the stream.
ReadShortUse this function to read a short integer value into a REALbasic integer variable.
WriteUse this method to write data to the stream.
WriteBlockCall the WriteBlock method in a loop to let the stream write data from the shared MemoryBlock.
WriteByteUse this method to write a single byte stored in Integer to the stream.
WriteBytesUse this method to write data to the stream. In this method the length parameter will control how much of the string will be written.
WriteLongUse this method to write a REALbasic Integer as Long Integer to the stream.
WritePStringUse this method to write a Pascal string to the stream.
WriteShortUse this method to write a REALbasic Integer as short Integer to the stream.

Supported Platforms:

  • PPC - MacOS 9
  • Carbon - MacOS 9 and MacOS X (PEF)
  • MacOS X PPC - (Mach-O)
  • MacOS X Universal Binary (Mach-O)
  • Win32 - Windows
  • Linux x86