| A. Files | B. Directories | C. Disks/Drives | D. File I/O | E. Stream I/O | F. Port I/O |
(
Bookmark)
| general |
Chapter 6, Streaming |
||||||||||||||||||||||||||||||
| File Open Mode constants | Use the file open mode constants to control the shareability of a file or stream when it's opened.
|
||||||||||||||||||||||||||||||
| How to store records to stream | ... and retrieve them later www.rksolution.cz/delphi/dtip0003.txt |
||||||||||||||||||||||||||||||
| LoadFromStream | Steve Schafer's UseNet Post with procedures SaveGraphicToStream and LoadGraphicFromStream | ||||||||||||||||||||||||||||||
| SaveToStream | Steve Schafer's UseNet Post with procedures SaveGraphicToStream and LoadGraphicFromStream | ||||||||||||||||||||||||||||||
| Seek | Classes Unit: soFromBeginning = 0 soFromCurrent = 1 soFromEnd = 2 - YUV Lab Reports (see YVU-9/YVU-12 example for simultaneously reading three file streams from same file after seeking to different start points) |
||||||||||||||||||||||||||||||
| TFiler | How to save/ load any TPicture-contained
TGraphic to/ from a stream www.lmc-mediaagentur.de/dpool/tips04/0367.htm |
||||||||||||||||||||||||||||||
Example:
VAR
FileName : STRING;
FileStream: TFileStream;
s : STRING;
. . .
FileName := ArticleDirectory + '\' +
ArticleFilename + '.TXT';
FileStream := TFileStream.Create(FileName,
fmCreate or fmOpenWrite or fmShareExclusive);
TRY
s := NMNNTP.Header.Text;
FileStream.Write(s[1], LENGTH(s));
s := NMNNTP.Body.Text;
FileStream.Write(s[1], LENGTH(s))
FINALLY
FileStream.Free
END;
efg's Combine files/Split file example. Combine five given files, 1.DAT, ..., 5.DAT into a single COMBINED.DAT file. Split the COMBINED.DAT file back into the original files, but with a new extension, 1.BIN, 2.BIN, ... efg's Combine JPGs, split and display example. Combine files 1.JPG, 2.JPG, 3.JPG into a single file. Read the combined file and display the original JPGs in TImages. efg's Resource Demo application shows how to use the following file types in resource files: BMP, ICO, JPG, GIF (requires Anders Melander's TGIFImage), EMF, TXT, AVI, WAV, cursors, and a matrix of binary data (Integers and Doubles). Requires D4 (or above) for the dynamic array of binary data. The 2D dynamic array is written to a file using a TFileStream. Also see: |
|||||||||||||||||||||||||||||||
| TIFileStream (IStreams) |
|||||||||||||||||||||||||||||||
| TIMemoryStream (IStreams) |
|||||||||||||||||||||||||||||||
| TIStreamAdapter (IStreams) |
Dan Russell's UseNet Posting about converting TFileStream to IStream | ||||||||||||||||||||||||||||||
| TMapStream | Three memory mapped file classes: TMapStream, TTextMap, and
TRecordMap. Useful when you'd like to use Pascal's file of record or textfile types, but
need memory mapping. Options for mutexes, encryption, & file headers. Heavily
commented code, and helpfile included. By Deborah Pate. www.djpate.freeserve.co.uk/MapFiles.zip |
||||||||||||||||||||||||||||||
| How to move a string into
a TMemoryStream or TFileStream http://community.borland.com/article/0,1410,26416,00.html efg's Combine files/Split file example. Combine five given files, 1.DAT, ..., 5.DAT into a single COMBINED.DAT file. Split the COMBINED.DAT file back into the original files, but with a new extension, 1.BIN, 2.BIN, ... Thomas Kowalski's Drehen90Grad (Rotate bitmap 90 degree) routine in Unit7 shows how to use a memory stream to access the TBitmapInfo header and the pixel data in a bitmap. TMemoryStream Example: How to copy the content of a TRichEdit
without loosing the RTF format?
Peter Below's UseNet Post with SaveBitmapToStream
and LoadBitmapFromStream examples. Chris Willig's UseNet Post with example of reading file in chunks Ronald Hoek's UseNet Post about playing audio from a TMemoryStream Example of how to compare two TIcons efg's UseNet Post about how to flip a TBitmap by writing Scanlines to a MemoryStream and loading the Scanlines of a second TBitmap in the flipped order. efg's Lead Tools-to-Delphi conversions show how how to start with a hDIB and end up with a TBitmap. In particular, look at Method 2, hDIB to TBitmap resulting in a bmDIB using a MemoryStream. Bob Villiers' UseNet Post with VarArrayLoadFile, which loads a bitmap into a variant using BlockRead, and then uses LoadFromStream to load into a memory stream. JPEG File Encryption/Decryption How to save/ load any TPicture-contained TGraphic to/ from a stream Other Examples:
|
|||||||||||||||||||||||||||||||
|
TResourceStream |
efg's Resource Demo application shows how to use the following file types in resource files: BMP, ICO, JPG, GIF (requires Anders Melander's TGIFImage), EMF, TXT, AVI, WAV, cursors, and a matrix of binary data (Integers and Doubles). Requires D4 (or above) for the dynamic array of binary data. | ||||||||||||||||||||||||||||||
| Steve Schafer's UseNet Post with procedures SaveGraphicToStream
and LoadGraphicFromStream Steve Schafer's UseNet Post with CopyStreamToFile procedure Mike Orriss' UseNet Post with CompressStream and ExpandStream procedure using Zlib. |
Updated 07 Oct 2007
since 19 Apr 1999