developer-delphi-rtl-streams-io

Guide Delphi RTL stream I/O with TFileStream, TMemoryStream, and TEncoding.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-rtl-streams-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developer-delphi-rtl-streams-io
Source: https://github.com/cslsoftwares/ParamentersORM/tree/main/.cursor/skills/developer-delphi-rtl-streams-io_V1.1.0
Command: npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-rtl-streams-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Delphi developers often struggle with consistent and efficient I/O via streams in the RTL, including file streams, memory streams, and encoding tasks. This skill consolidates practical guidance and examples for TStream, TFileStream, TMemoryStream, TIOUtils, encoding handling, compression, and simple serialization.

Core Features & Use Cases

  • TStream, TFileStream, TMemoryStream, TIOUtils usage patterns for reading/writing text and binary data.
  • Encoding handling (TEncoding, BOM detection, cross-platform text) and basic compression/serialization templates.
  • Real-world use cases: file ingestion, binary serialization, and inter-stream data transfer.

Quick Start

Read a binary file into a memory stream and serialize it to another stream with encoding conversion.

Frequently Asked Questions about developer-delphi-rtl-streams-io

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read and write binary or text data using Delphi TFileStream and TMemoryStream?

Delphi TStream-based APIs handle binary and text I/O by transferring data between TFileStream and TMemoryStream. You read bytes into memory streams from files and write them back, applying encoding handling and serialization templates for structured data operations.

What is the best way to handle text encoding and BOM detection in Delphi RTL streams?

Text encoding in Delphi RTL streams is managed using TEncoding with BOM detection for cross-platform compatibility. When reading text via TStream or TIOUtils, you detect the byte order mark to correctly decode UTF-8 or UTF-16 text data into strings.

Can I use TIOUtils and TPath for cross-platform file operations in Delphi?

TIOUtils and TPath/TFile/TDirectory support cross-platform file operations in Delphi RTL. You can read, write, and manage files across Windows and macOS using these APIs, ensuring consistent path handling and stream-based data ingestion.

How does inter-stream data transfer and binary serialization work in Delphi?

Inter-stream data transfer in Delphi copies bytes directly between TStream instances like TFileStream and TMemoryStream. Binary serialization templates structure this data, allowing you to serialize objects or binary payloads into a target stream with encoding conversion applied.

Do I need compression and serialization templates for Delphi stream I/O tasks?

Compression and serialization templates extend Delphi stream I/O by reducing data size and structuring binary payloads. While basic TFileStream reading and writing does not require them, they are necessary for efficient file ingestion and inter-stream data transfer of complex objects.