ResourceStream REALbasic Plugin

ResourceStream Class

The ResourceStream class is to stream file resource forks.
(The ResourceStream has similar programming interface as the built in REALbasic BinaryStream, which is for data forks)

This class is only for MacOS Classic and MacOS X because ResourceFork's are MacOS specific operating system feature. The class has empty stubs for Windows and Linux systems to help developing for MacOS system from REALbasic Windows and Linux IDE's.

Object
   ResourceStream

class ResourceStream implements

IBinaryStreamReader

IBinaryStreamWriter

IBlockReader

IBlockWriter

Constructors

ResourceStreamThe default constructor for the ResourceStream, which takes a FolderItem and a Boolean parameter.
ResourceStreamUse 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. The Purpose of this property is to allow people to extend the class with API calls.
LengthThis property will get or set the length of the Stream.
PositionUse this property to set or get the position of the file cursor within the stream.

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.
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)

    Unsupported Platforms:

  • Win32 - Windows
  • Linux x86