mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 21:09:11 +02:00
* Add Read/Write(Buffer) TBytes, ReadData/WriteData, ReadBufferData/WriteBufferData to be Delphi compatible
git-svn-id: trunk@42042 -
This commit is contained in:
parent
e958438fc9
commit
60efc9e81c
@ -894,13 +894,158 @@ type
|
|||||||
procedure SetSize(const NewSize: Int64); virtual;overload;
|
procedure SetSize(const NewSize: Int64); virtual;overload;
|
||||||
procedure ReadNotImplemented;
|
procedure ReadNotImplemented;
|
||||||
procedure WriteNotImplemented;
|
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
|
public
|
||||||
function Read(var Buffer; Count: Longint): Longint; virtual;
|
function Read(var Buffer; Count: Longint): Longint; virtual;
|
||||||
|
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 Write(const Buffer; Count: Longint): Longint; virtual;
|
||||||
|
|
||||||
function Seek(Offset: Longint; Origin: Word): Longint; virtual; overload;
|
function Seek(Offset: Longint; Origin: Word): Longint; virtual; overload;
|
||||||
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; 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; 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; 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 CopyFrom(Source: TStream; Count: Int64): Int64;
|
||||||
function ReadComponent(Instance: TComponent): TComponent;
|
function ReadComponent(Instance: TComponent): TComponent;
|
||||||
function ReadComponentRes(Instance: TComponent): TComponent;
|
function ReadComponentRes(Instance: TComponent): TComponent;
|
||||||
@ -990,6 +1135,7 @@ type
|
|||||||
private
|
private
|
||||||
FMemory: Pointer;
|
FMemory: Pointer;
|
||||||
FSize, FPosition: PtrInt;
|
FSize, FPosition: PtrInt;
|
||||||
|
FSizeBoundsSeek : Boolean;
|
||||||
protected
|
protected
|
||||||
Function GetSize : Int64; Override;
|
Function GetSize : Int64; Override;
|
||||||
function GetPosition: Int64; Override;
|
function GetPosition: Int64; Override;
|
||||||
@ -1000,6 +1146,7 @@ type
|
|||||||
procedure SaveToStream(Stream: TStream);
|
procedure SaveToStream(Stream: TStream);
|
||||||
procedure SaveToFile(const FileName: string);
|
procedure SaveToFile(const FileName: string);
|
||||||
property Memory: Pointer read FMemory;
|
property Memory: Pointer read FMemory;
|
||||||
|
Property SizeBoundsSeek : Boolean Read FSizeBoundsSeek Write FSizeBoundsSeek;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TMemoryStream }
|
{ TMemoryStream }
|
||||||
|
@ -30,6 +30,26 @@ begin
|
|||||||
Result := 0;
|
Result := 0;
|
||||||
end;
|
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;
|
function TStream.Write(const Buffer; Count: Longint): Longint;
|
||||||
begin
|
begin
|
||||||
WriteNotImplemented;
|
WriteNotImplemented;
|
||||||
@ -178,35 +198,719 @@ end;
|
|||||||
Result:=Seek(longint(Offset),ord(Origin));
|
Result:=Seek(longint(Offset),ord(Origin));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TStream.ReadBuffer(var Buffer; Count: Longint);
|
function TStream.ReadData(Buffer: Pointer; Count: NativeInt): NativeInt;
|
||||||
|
begin
|
||||||
|
Result:=Read(Buffer^,Count);
|
||||||
|
end;
|
||||||
|
|
||||||
Var
|
function TStream.ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt;
|
||||||
r,t : longint;
|
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.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;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
t:=0;
|
T:=0;
|
||||||
repeat
|
Repeat
|
||||||
r:=Read(PByte(@Buffer)[t],Count-t);
|
r:=Write(PByte(@Buffer)[t],Count-t);
|
||||||
inc(t,r);
|
inc(t,r);
|
||||||
until (t=Count) or (r<=0);
|
Until (t=count) or (r<=0);
|
||||||
if (t<Count) then
|
if (t<Count) then
|
||||||
Raise EReadError.Create(SReadError);
|
Raise EWriteError.Create(SWriteError);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TStream.WriteBuffer(const Buffer; Count: Longint);
|
procedure TStream.WriteBuffer(const Buffer: TBytes; Count: NativeInt);
|
||||||
|
begin
|
||||||
|
WriteBuffer(Buffer,0,Count);
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
procedure TStream.WriteBuffer(const Buffer: TBytes; Offset, Count: NativeInt);
|
||||||
r,t : Longint;
|
begin
|
||||||
|
WriteBuffer(Buffer[Offset],Count);
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
function TStream.WriteData(const Buffer: TBytes; Count: NativeInt): NativeInt;
|
||||||
T:=0;
|
begin
|
||||||
Repeat
|
Result:=Write(Buffer, 0, Count);
|
||||||
r:=Write(PByte(@Buffer)[t],Count-t);
|
end;
|
||||||
inc(t,r);
|
|
||||||
Until (t=count) or (r<=0);
|
function TStream.WriteData(const Buffer: Pointer; Count: NativeInt): NativeInt;
|
||||||
if (t<Count) then
|
begin
|
||||||
Raise EWriteError.Create(SWriteError);
|
Result:=Write(Buffer^, Count);
|
||||||
end;
|
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;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
procedure TStream.WriteBufferData(Buffer: TExtended80Rec; Count: NativeInt);
|
||||||
|
begin
|
||||||
|
WriteExactSizeData(Buffer,SizeOf(Buffer),Count);
|
||||||
|
end;
|
||||||
|
|
||||||
function TStream.CopyFrom(Source: TStream; Count: Int64): Int64;
|
function TStream.CopyFrom(Source: TStream; Count: Int64): Int64;
|
||||||
|
|
||||||
@ -447,6 +1151,7 @@ end;
|
|||||||
TheSize : Longint;
|
TheSize : Longint;
|
||||||
P : PByte ;
|
P : PByte ;
|
||||||
begin
|
begin
|
||||||
|
Result:='';
|
||||||
ReadBuffer (TheSize,SizeOf(TheSize));
|
ReadBuffer (TheSize,SizeOf(TheSize));
|
||||||
SetLength(Result,TheSize);
|
SetLength(Result,TheSize);
|
||||||
// Illegal typecast if no AnsiStrings defined.
|
// Illegal typecast if no AnsiStrings defined.
|
||||||
@ -621,6 +1326,8 @@ begin
|
|||||||
soFromEnd : FPosition:=FSize+Offset;
|
soFromEnd : FPosition:=FSize+Offset;
|
||||||
soFromCurrent : FPosition:=FPosition+Offset;
|
soFromCurrent : FPosition:=FPosition+Offset;
|
||||||
end;
|
end;
|
||||||
|
if SizeBoundsSeek and (FPosition>FSize) then
|
||||||
|
FPosition:=FSize;
|
||||||
Result:=FPosition;
|
Result:=FPosition;
|
||||||
{$IFDEF DEBUG}
|
{$IFDEF DEBUG}
|
||||||
if Result < 0 then
|
if Result < 0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user