TStringStream.Create¶
Creates a new stringstream and sets its initial content.
Declaration¶
Source position: classesh.inc line 1673
public
constructor Create(const ABytes: TBytes); override; overload; overload;
constructor Create; overload; overload;
constructor Create(const AString: AnsiString); overload; overload;
constructor Create(const AString: Ansistring; AEncoding: TEncoding;
AOwnsEncoding: Boolean=True); overload; overload;
constructor Create(const AString: Ansistring; ACodePage: Integer)
; overload; overload;
constructor Create(const AString: UnicodeString); overload; overload;
constructor Create(const AString: UnicodeString; AEncoding: TEncoding;
AOwnsEncoding: Boolean=True); overload; overload;
constructor Create(const AString: UnicodeString; ACodePage: Integer)
; overload; overload;
Description¶
Create creates a new TStringStream instance and sets its initial content to Astring. The position is still 0 but the size of the stream will equal the length of the string.
The Encoding argument specifies the codepage with which the bytes in the string will be interpreted. If it is not specified (or Nil) the system default encoding will be used. The correct encoding can be detected from the string by using the TStringStream.CreateRaw constructor.
See also¶
| Name | Description |
|---|---|
| TStringStream.DataString | Contains the contents of the stream in string form. |
| TStringStream.UnicodeDataString | Datastring as unicode string. |
| TStringStream.Encoding | Encoding of the string with the data. |
| TStringStream.CreateRaw | Create stringstream using codepage of string. |