TCachedDataStream class
Base cached stream class
Declaration
TCachedDataStream = class(TStream)Inheritance
Descends from it: TCachedResourceDataStream TGroupCachedDataStream
Description
This abstract class provides basic cached stream functionalities.
A cached stream is a read-only stream that operates on a portion of another stream. That is, it creates a "window" on the original stream from which to read data. Since it is a read-only stream, trying to write to the stream or to set its size cause an EInvalidOperation exception to be raised.
This class is used by TResourceDataStream to access the raw data of a resource. When an attempt to write to the stream is detected, TResourceDataStream replaces it with a memory stream and copies the contents of the cached stream to the memory one, thus providing a copy-on-write mechanism.
See also
Methods
GetPosition | protected | |
SetPosition | protected | |
GetSize | protected | Return the size of the stream. |
SetSize64 | protected | |
Create | public | Creates a new object |
Write | public | Write a number of bytes to the stream. |
Seek | public | Set stream position. |
Fields
fStream | protected | The original stream |
fSize | protected | The size of the cached stream |
fPosition | protected | The position from the cached stream perspective |
Inherited
From TObject (41)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Destroy Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
