Selaa lähdekoodia

* Undo 42424

git-svn-id: branches/fixes_3_2@42441 -
michael 6 vuotta sitten
vanhempi
commit
807a917a5f

+ 1 - 2
packages/fcl-db/src/sqldb/oracle/oracleconnection.pp

@@ -1,7 +1,7 @@
 unit oracleconnection;
 
 {
-    Copyright (c) 2006-2019 by Joost van der Sluis, FPC contributors
+    Copyright (c) 2006-2014 by Joost van der Sluis, FPC contributors
 
     Oracle RDBMS connector using the OCI protocol
 
@@ -358,7 +358,6 @@ begin
 
       case DataType of
         ftInteger         : AsInteger := PInteger(ParamBuffers[i].buffer)^;
-        ftLargeint        : AsLargeInt := PInt64(ParamBuffers[i].buffer)^;
         ftFloat           : AsFloat := PDouble(ParamBuffers[i].buffer)^;
         ftString          : begin
                             SetLength(s,ParamBuffers[i].Len);

+ 2 - 2
packages/fcl-web/src/restbridge/sqldbrestschema.pp

@@ -256,6 +256,7 @@ Type
     procedure SetResources(AValue: TSQLDBRestResourceList);
   Protected
     function CreateResourceList: TSQLDBRestResourceList; virtual;
+    function GetPrimaryIndexFields(Q: TSQLQuery): TStringArray; virtual;
     function ProcessIdentifier(const S: UTF8String): UTF8String; virtual;
     Function AttachProcessor(aProcessor : TSQLDBRestCustomBusinessProcessor) : Boolean; Virtual;
     Function DetachProcessor(aProcessor : TSQLDBRestCustomBusinessProcessor) : Boolean; Virtual;
@@ -272,7 +273,6 @@ Type
     Procedure LoadFromFile(Const aFileName : UTF8String);
     Procedure LoadFromStream(Const aStream : TStream);
     Procedure FromJSON(aData: TJSONData;const aPropName: UTF8String='');
-    Class function GetPrimaryIndexFields(Q: TSQLQuery): TStringArray; virtual;
     procedure PopulateResourceFields(aConn: TSQLConnection; aRes: TSQLDBRestResource; aMinFieldOpts : TRestFieldOptions = []); virtual;
     procedure PopulateResources(aConn: TSQLConnection; aTables: array of string; aMinFieldOpts: TRestFieldOptions= []);
     Procedure PopulateResources(aConn : TSQLConnection; aTables : TStrings = Nil; aMinFieldOpts : TRestFieldOptions = []);
@@ -627,7 +627,7 @@ begin
 end;
 
 
-class function TSQLDBRestSchema.GetPrimaryIndexFields(Q: TSQLQuery): TStringArray;
+function TSQLDBRestSchema.GetPrimaryIndexFields(Q: TSQLQuery): TStringArray;
 
 Var
   C,I : Integer;

+ 3 - 22
packages/rtl-objpas/src/inc/dateutil.inc

@@ -448,7 +448,7 @@ function TryISOStrToTime(const aString: string; Out outTime: TDateTime): Boolean
 // Combination of previous
 function TryISOStrToDateTime(const aString: string; out outDateTime: TDateTime): Boolean;
 // Z +hh:nn -hh:nn
-Function TryISOTZStrToTZOffset(const TZ : String; Out TZOffset : Integer) : boolean;
+Function TryISOTZStrToTZOffset(TZ : String; Out TZOffset : Integer) : boolean;
 
 // ISO 8601 Date/Time formatting
 
@@ -2857,7 +2857,7 @@ begin
     outDateTime := 0;
 end;
 
-Function TryISOTZStrToTZOffset(const TZ : String; Out TZOffset : Integer) : boolean;
+Function TryISOTZStrToTZOffset(TZ : String; Out TZOffset : Integer) : boolean;
 
 Var
   H,M : LongInt;
@@ -2871,16 +2871,7 @@ begin
     Result:=TZ[1] in ['+','-'];
     if Not Result then
       Exit;
-    case Length(TZ) of
-      3: begin
-        Result:=TryStrToInt(Copy(TZ,2,2),H);
-        M := 0;
-      end;
-      5: Result:=TryStrToInt(Copy(TZ,2,2),H) and TryStrToInt(Copy(TZ,4,2),M);
-      6: Result:=TryStrToInt(Copy(TZ,2,2),H) and TryStrToInt(Copy(TZ,5,2),M);
-    else
-      Result := False;
-    end;
+    Result:=TryStrToInt(Copy(TZ,2,2),H) and TryStrToInt(Copy(TZ,5,2),M);
     if not Result then
       exit;
     TZOffset:=H*60+M;
@@ -2913,16 +2904,6 @@ begin
     TZ:='Z';
     S:=Copy(S,1,L-1);
     end
-  else If (L>2) and (S[L-2] in ['+','-']) then
-    begin
-    TZ:=Copy(S,L-2,3);
-    S:=Copy(S,1,L-3);
-    end
-  else If (L>4) and (S[L-4] in ['+','-']) then
-    begin
-    TZ:=Copy(S,L-4,5);
-    S:=Copy(S,1,L-5);
-    end
   else If (L>5) and (S[L-5] in ['+','-']) then
     begin
     TZ:=Copy(S,L-5,6);

+ 0 - 147
rtl/objpas/classes/classesh.inc

@@ -892,158 +892,13 @@ type
     procedure SetSize(const NewSize: Int64); virtual;overload;
     procedure ReadNotImplemented;
     procedure WriteNotImplemented;
-    function ReadMaxSizeData(Var Buffer; aSize,aCount : NativeInt) : NativeInt;
-    Procedure ReadExactSizeData(Var Buffer; aSize,aCount : NativeInt);
-    function WriteMaxSizeData(Const Buffer; aSize,aCount : NativeInt) : NativeInt;
-    Procedure WriteExactSizeData(Const Buffer; aSize,aCount : NativeInt);
   public
     function Read(var Buffer; Count: Longint): Longint; virtual; overload;
-    function Read(Buffer: TBytes; Count: Longint): Longint; overload;
-    function Read(Buffer : TBytes; aOffset, Count: Longint): Longint; overload;
-
-    function Write(const Buffer: TBytes; Offset, Count: Longint): Longint; overload;
-    function Write(const Buffer: TBytes; Count: Longint): Longint; overload;
     function Write(const Buffer; Count: Longint): Longint; virtual;
-
     function Seek(Offset: Longint; Origin: Word): Longint; virtual; overload;
     function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; virtual; overload;
-
-    function ReadData(Buffer: Pointer; Count: NativeInt): NativeInt; overload;
-    function ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Boolean): NativeInt; overload;
-    function ReadData(var Buffer: Boolean; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: AnsiChar): NativeInt; overload;
-    function ReadData(var Buffer: AnsiChar; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: WideChar): NativeInt; overload;
-    function ReadData(var Buffer: WideChar; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Int8): NativeInt; overload;
-    function ReadData(var Buffer: Int8; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: UInt8): NativeInt; overload;
-    function ReadData(var Buffer: UInt8; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Int16): NativeInt; overload;
-    function ReadData(var Buffer: Int16; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: UInt16): NativeInt; overload;
-    function ReadData(var Buffer: UInt16; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Int32): NativeInt; overload;
-    function ReadData(var Buffer: Int32; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: UInt32): NativeInt; overload;
-    function ReadData(var Buffer: UInt32; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Int64): NativeInt; overload;
-    function ReadData(var Buffer: Int64; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: UInt64): NativeInt; overload;
-    function ReadData(var Buffer: UInt64; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Single): NativeInt; overload;
-    function ReadData(var Buffer: Single; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Double): NativeInt; overload;
-    function ReadData(var Buffer: Double; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: Extended): NativeInt; overload;
-    function ReadData(var Buffer: Extended; Count: NativeInt): NativeInt; overload;
-    function ReadData(var Buffer: TExtended80Rec): NativeInt; overload;
-    function ReadData(var Buffer: TExtended80Rec; Count: NativeInt): NativeInt; overload;
-
     procedure ReadBuffer(var Buffer; Count: Longint);
-    procedure ReadBuffer(var Buffer: TBytes; Count: NativeInt); overload;
-    procedure ReadBuffer(var Buffer: TBytes; Offset, Count: NativeInt); overload;
-
-    procedure ReadBufferData(var Buffer: Boolean); overload;
-    procedure ReadBufferData(var Buffer: Boolean; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: AnsiChar); overload;
-    procedure ReadBufferData(var Buffer: AnsiChar; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: WideChar); overload;
-    procedure ReadBufferData(var Buffer: WideChar; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Int8); overload;
-    procedure ReadBufferData(var Buffer: Int8; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: UInt8); overload;
-    procedure ReadBufferData(var Buffer: UInt8; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Int16); overload;
-    procedure ReadBufferData(var Buffer: Int16; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: UInt16); overload;
-    procedure ReadBufferData(var Buffer: UInt16; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Int32); overload;
-    procedure ReadBufferData(var Buffer: Int32; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: UInt32); overload;
-    procedure ReadBufferData(var Buffer: UInt32; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Int64); overload;
-    procedure ReadBufferData(var Buffer: Int64; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: UInt64); overload;
-    procedure ReadBufferData(var Buffer: UInt64; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Single); overload;
-    procedure ReadBufferData(var Buffer: Single; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Double); overload;
-    procedure ReadBufferData(var Buffer: Double; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: Extended); overload;
-    procedure ReadBufferData(var Buffer: Extended; Count: NativeInt); overload;
-    procedure ReadBufferData(var Buffer: TExtended80Rec); overload;
-    procedure ReadBufferData(var Buffer: TExtended80Rec; Count: NativeInt); overload;
-
     procedure WriteBuffer(const Buffer; Count: Longint);
-    procedure WriteBuffer(const Buffer: TBytes; Count: NativeInt); overload;
-    procedure WriteBuffer(const Buffer: TBytes; Offset, Count: NativeInt); overload;
-
-    function WriteData(const Buffer: TBytes; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Pointer; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Boolean): NativeInt; overload;
-    function WriteData(const Buffer: Boolean; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: AnsiChar): NativeInt; overload;
-    function WriteData(const Buffer: AnsiChar; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: WideChar): NativeInt; overload;
-    function WriteData(const Buffer: WideChar; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Int8): NativeInt; overload;
-    function WriteData(const Buffer: Int8; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: UInt8): NativeInt; overload;
-    function WriteData(const Buffer: UInt8; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Int16): NativeInt; overload;
-    function WriteData(const Buffer: Int16; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: UInt16): NativeInt; overload;
-    function WriteData(const Buffer: UInt16; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Int32): NativeInt; overload;
-    function WriteData(const Buffer: Int32; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: UInt32): NativeInt; overload;
-    function WriteData(const Buffer: UInt32; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Int64): NativeInt; overload;
-    function WriteData(const Buffer: Int64; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: UInt64): NativeInt; overload;
-    function WriteData(const Buffer: UInt64; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Single): NativeInt; overload;
-    function WriteData(const Buffer: Single; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Double): NativeInt; overload;
-    function WriteData(const Buffer: Double; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: Extended): NativeInt; overload;
-    function WriteData(const Buffer: Extended; Count: NativeInt): NativeInt; overload;
-    function WriteData(const Buffer: TExtended80Rec): NativeInt; overload;
-    function WriteData(const Buffer: TExtended80Rec; Count: NativeInt): NativeInt; overload;
-
-    procedure WriteBufferData(Buffer: Integer); overload;
-    procedure WriteBufferData(Buffer: Integer; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Boolean); overload;
-    procedure WriteBufferData(Buffer: Boolean; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: AnsiChar); overload;
-    procedure WriteBufferData(Buffer: AnsiChar; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: WideChar); overload;
-    procedure WriteBufferData(Buffer: WideChar; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Int8); overload;
-    procedure WriteBufferData(Buffer: Int8; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: UInt8); overload;
-    procedure WriteBufferData(Buffer: UInt8; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Int16); overload;
-    procedure WriteBufferData(Buffer: Int16; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: UInt16); overload;
-    procedure WriteBufferData(Buffer: UInt16; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: UInt32); overload;
-    procedure WriteBufferData(Buffer: UInt32; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Int64); overload;
-    procedure WriteBufferData(Buffer: Int64; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: UInt64); overload;
-    procedure WriteBufferData(Buffer: UInt64; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Single); overload;
-    procedure WriteBufferData(Buffer: Single; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Double); overload;
-    procedure WriteBufferData(Buffer: Double; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: Extended); overload;
-    procedure WriteBufferData(Buffer: Extended; Count: NativeInt); overload;
-    procedure WriteBufferData(Buffer: TExtended80Rec); overload;
-    procedure WriteBufferData(Buffer: TExtended80Rec; Count: NativeInt); overload;
-
     function CopyFrom(Source: TStream; Count: Int64): Int64;
     function ReadComponent(Instance: TComponent): TComponent;
     function ReadComponentRes(Instance: TComponent): TComponent;
@@ -1133,7 +988,6 @@ type
   private
     FMemory: Pointer;
     FSize, FPosition: PtrInt;
-    FSizeBoundsSeek : Boolean;
   protected
     Function GetSize : Int64; Override;
     function GetPosition: Int64; Override;
@@ -1144,7 +998,6 @@ type
     procedure SaveToStream(Stream: TStream);
     procedure SaveToFile(const FileName: string);
     property Memory: Pointer read FMemory;
-    Property SizeBoundsSeek : Boolean Read FSizeBoundsSeek Write FSizeBoundsSeek;
   end;
 
 { TMemoryStream }

+ 21 - 728
rtl/objpas/classes/streams.inc

@@ -30,26 +30,6 @@ begin
   Result := 0;
 end;
 
-function TStream.Read(Buffer: TBytes; Count: Longint): Longint;
-begin
-  Result:=Read(Buffer,0,Count);
-end;
-
-function TStream.Read(Buffer: TBytes; aOffset, Count: Longint): Longint;
-begin
-  Result:=Read(Buffer[aOffset],Count);
-end;
-
-function TStream.Write(const Buffer: TBytes; Offset, Count: Longint): Longint;
-begin
-  Result:=Write(Buffer[Offset],Count);
-end;
-
-function TStream.Write(const Buffer: TBytes; Count: Longint): Longint;
-begin
-  Result:=Write(Buffer,0,Count);
-end;
-
 function TStream.Write(const Buffer; Count: Longint): Longint;
 begin
   WriteNotImplemented;
@@ -198,719 +178,35 @@ end;
       Result:=Seek(longint(Offset),ord(Origin));
     end;
 
- function TStream.ReadData(Buffer: Pointer; Count: NativeInt): NativeInt;
- begin
-   Result:=Read(Buffer^,Count);
- end;
-
- function TStream.ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt;
- begin
-   Result:=Read(Buffer,0,Count);
- end;
-
- function TStream.ReadData(var Buffer: Boolean): NativeInt;
- begin
-   Result:=Read(Buffer,sizeOf(Buffer));
- end;
-
-function TStream.ReadMaxSizeData(Var Buffer; aSize,aCount : NativeInt) : NativeInt;
-
-Var
-  CP : Int64;
-
-begin
-  if aCount<=aSize then
-    Result:=read(Buffer,aCount)
-  else
-    begin
-    Result:=Read(Buffer,aSize);
-    CP:=Position;
-    Result:=Result+Seek(aCount-aSize,soCurrent)-CP;
-    end
-end;
-
-function TStream.WriteMaxSizeData(Const Buffer; aSize,aCount : NativeInt) : NativeInt;
-Var
-  CP : Int64;
-
-begin
-  if aCount<=aSize then
-    Result:=Write(Buffer,aCount)
-  else
-    begin
-    Result:=Write(Buffer,aSize);
-    CP:=Position;
-    Result:=Result+Seek(aCount-aSize,soCurrent)-CP;
-    end
-end;
-
-procedure TStream.WriteExactSizeData(const Buffer; aSize, aCount: NativeInt);
-begin
-  // Embarcadero docs mentions no exception. Does not seem very logical
-  WriteMaxSizeData(Buffer,aSize,ACount);
-end;
-
-procedure TStream.ReadExactSizeData(var Buffer; aSize, aCount: NativeInt);
-begin
-  if ReadMaxSizeData(Buffer,aSize,ACount)<>aCount then
-     Raise EReadError.Create(SReadError);
-end;
-
-
-function TStream.ReadData(var Buffer: Boolean; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: AnsiChar): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: AnsiChar; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: WideChar): NativeInt;
-begin
- Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: WideChar; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Int8): NativeInt;
-begin
- Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Int8; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: UInt8): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: UInt8; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Int16): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Int16; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: UInt16): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: UInt16; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Int32): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Int32; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: UInt32): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: UInt32; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Int64): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Int64; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: UInt64): NativeInt;
-begin
- Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: UInt64; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Single): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Single; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Double): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Double; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: Extended): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: Extended; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.ReadData(var Buffer: TExtended80Rec): NativeInt;
-begin
-  Result:=Read(Buffer,sizeOf(Buffer));
-end;
-
-function TStream.ReadData(var Buffer: TExtended80Rec; Count: NativeInt): NativeInt;
-begin
-  Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBuffer(var Buffer; Count: Longint);
-
-Var
-  r,t : longint;
-
-begin
-  t:=0;
-  repeat
-    r:=Read(PByte(@Buffer)[t],Count-t);
-    inc(t,r);
-  until (t=Count) or (r<=0);
-  if (t<Count) then
-    Raise EReadError.Create(SReadError);
-end;
-
-procedure TStream.ReadBuffer(var Buffer: TBytes; Count: NativeInt);
-begin
-  ReadBuffer(Buffer,0,Count);
-end;
-
-procedure TStream.ReadBuffer(var Buffer: TBytes; Offset, Count: NativeInt);
-begin
-  ReadBuffer(Buffer[OffSet],Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Boolean);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Boolean; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: AnsiChar);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: AnsiChar; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: WideChar);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: WideChar; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int8);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int8; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt8);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt8; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int16);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int16; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt16);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt16; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int32);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int32; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt32);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt32; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int64);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Int64; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt64);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: UInt64; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Single);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Single; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Double);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
+  procedure TStream.ReadBuffer(var Buffer; Count: Longint);
 
-procedure TStream.ReadBufferData(var Buffer: Double; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Extended);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: Extended; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.ReadBufferData(var Buffer: TExtended80Rec);
-begin
-  ReadBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.ReadBufferData(var Buffer: TExtended80Rec; Count: NativeInt);
-begin
-  ReadExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBuffer(const Buffer; Count: Longint);
-
-var
-  r,t : Longint;
+  Var
+    r,t : longint;
 
   begin
-    T:=0;
-    Repeat
-       r:=Write(PByte(@Buffer)[t],Count-t);
-       inc(t,r);
-    Until (t=count) or (r<=0);
+    t:=0;
+    repeat
+      r:=Read(PByte(@Buffer)[t],Count-t);
+      inc(t,r);
+    until (t=Count) or (r<=0);
     if (t<Count) then
-       Raise EWriteError.Create(SWriteError);
+      Raise EReadError.Create(SReadError);
   end;
 
-procedure TStream.WriteBuffer(const Buffer: TBytes; Count: NativeInt);
-begin
-  WriteBuffer(Buffer,0,Count);
-end;
-
-procedure TStream.WriteBuffer(const Buffer: TBytes; Offset, Count: NativeInt);
-begin
-  WriteBuffer(Buffer[Offset],Count);
-end;
-
-function TStream.WriteData(const Buffer: TBytes; Count: NativeInt): NativeInt;
-begin
-  Result:=Write(Buffer, 0, Count);
-end;
-
-function TStream.WriteData(const Buffer: Pointer; Count: NativeInt): NativeInt;
-begin
-  Result:=Write(Buffer^, Count);
-end;
-
-function TStream.WriteData(const Buffer: Boolean): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Boolean; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: AnsiChar): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: AnsiChar; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: WideChar): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: WideChar; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Int8): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Int8; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: UInt8): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: UInt8; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Int16): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Int16; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: UInt16): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: UInt16; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Int32): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Int32; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: UInt32): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
+  procedure TStream.WriteBuffer(const Buffer; Count: Longint);
 
-function TStream.WriteData(const Buffer: UInt32; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Int64): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Int64; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: UInt64): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: UInt64; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Single): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Single; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Double): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Double; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: Extended): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: Extended; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-function TStream.WriteData(const Buffer: TExtended80Rec): NativeInt;
-begin
-  Result:=Write(Buffer,SizeOf(Buffer));
-end;
-
-function TStream.WriteData(const Buffer: TExtended80Rec; Count: NativeInt): NativeInt;
-begin
-  Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Integer);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Integer; Count: NativeInt);
-begin
-  WriteMaxSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Boolean);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Boolean; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: AnsiChar);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: AnsiChar; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: WideChar);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: WideChar; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Int8);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Int8; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt8);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt8; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Int16);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Int16; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt16);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt16; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt32);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt32; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Int64);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Int64; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt64);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: UInt64; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Single);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Single; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Double);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Double; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: Extended);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
-
-procedure TStream.WriteBufferData(Buffer: Extended; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
-
-procedure TStream.WriteBufferData(Buffer: TExtended80Rec);
-begin
-  WriteBuffer(Buffer,SizeOf(Buffer));
-end;
+  var
+    r,t : Longint;
 
-procedure TStream.WriteBufferData(Buffer: TExtended80Rec; Count: NativeInt);
-begin
-  WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
-end;
+    begin
+      T:=0;
+      Repeat
+         r:=Write(PByte(@Buffer)[t],Count-t);
+         inc(t,r);
+      Until (t=count) or (r<=0);
+      if (t<Count) then
+         Raise EWriteError.Create(SWriteError);
+    end;
 
   function TStream.CopyFrom(Source: TStream; Count: Int64): Int64;
 
@@ -1151,7 +447,6 @@ end;
     TheSize : Longint;
     P : PByte ;
   begin
-    Result:='';
     ReadBuffer (TheSize,SizeOf(TheSize));
     SetLength(Result,TheSize);
     // Illegal typecast if no AnsiStrings defined.
@@ -1326,8 +621,6 @@ begin
     soFromEnd       : FPosition:=FSize+Offset;
     soFromCurrent   : FPosition:=FPosition+Offset;
   end;
-  if SizeBoundsSeek and (FPosition>FSize) then
-    FPosition:=FSize;
   Result:=FPosition;
   {$IFDEF DEBUG}
   if Result < 0 then