* Allow to set the write buffer size (enlarged to 4k)

git-svn-id: trunk@23468 -
This commit is contained in:
michael 2013-01-21 10:52:38 +00:00
parent 5d74e0578a
commit 58a6886ed3

View File

@ -72,7 +72,7 @@ type
procedure VisitDocumentType(Node: TDOMNode);
procedure VisitPI(Node: TDOMNode);
public
constructor Create(AStream: TStream);
constructor Create(AStream: TStream; ACapacity : Cardinal = 4096);
destructor Destroy; override;
end;
@ -111,14 +111,14 @@ end;
THTMLWriter
---------------------------------------------------------------------}
constructor THTMLWriter.Create(AStream: TStream);
constructor THTMLWriter.Create(AStream: TStream; ACapacity : Cardinal = 4096);
begin
inherited Create;
FStream := AStream;
// some overhead - always be able to write at least one extra UCS4
FBuffer := AllocMem(512+32);
FCapacity := ACapacity;
FBuffer := AllocMem(FCapacity+32);
FBufPos := FBuffer;
FCapacity := 512;
// Later on, this may be put under user control
// for now, take OS setting
FLineBreak := sLineBreak;