Browse Source

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

git-svn-id: trunk@23468 -
michael 12 years ago
parent
commit
58a6886ed3
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/fcl-xml/src/htmwrite.pp

+ 4 - 4
packages/fcl-xml/src/htmwrite.pp

@@ -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;