Parcourir la source

* cleanup of base64 by Luiz Americo. Mantis #23021

git-svn-id: trunk@22557 -
marco il y a 13 ans
Parent
commit
869e65b576
1 fichiers modifiés avec 2 ajouts et 10 suppressions
  1. 2 10
      packages/fcl-base/src/base64.pp

+ 2 - 10
packages/fcl-base/src/base64.pp

@@ -36,7 +36,6 @@ type
     Buf: array[0..2] of Byte;
     BufSize: Integer;    // # of bytes used in Buf
   public
-    constructor Create(ASource: TStream);
     destructor Destroy; override;
     Function Flush : Boolean;
     function Write(const Buffer; Count: Longint): Longint; override;
@@ -127,11 +126,6 @@ const
 
   Alphabet = ['a'..'z','A'..'Z','0'..'9','+','/','=']; // all 65 chars that are in the base64 encoding alphabet
 
-constructor TBase64EncodingStream.Create(ASource: TStream);
-begin
-  inherited Create(ASource);
-end;
-
 function TBase64EncodingStream.Flush : Boolean;
 
 var
@@ -437,8 +431,7 @@ begin
       Decoder:=TBase64DecodingStream.Create(Instream,bdmMIME);
       try
          Outstream.CopyFrom(Decoder,Decoder.Size);
-         Outstream.Position:=0;
-         Result:=Outstream.ReadString(Outstream.Size);
+         Result:=Outstream.DataString;
       finally
         Decoder.Free;
         end;
@@ -464,8 +457,7 @@ begin
     finally 
       Encoder.Free;
       end;
-    Outstream.Position:=0;
-    Result:=Outstream.ReadString(Outstream.Size);
+    Result:=Outstream.DataString;
   finally
     Outstream.free;
     end;