C
copy_paste
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure AddStream(Source, Dest: TMemoryStream);
var
SourceSize, DestSize: Integer;
begin
DestSize := Dest.Size;
SourceSize := Source.Size;
Dest.Size := DestSize + SourceSize;
Move(Source.Memory^, Pointer(Integer(Dest.Memory) + DestSize)^, SourceSize)
end;
procedure DeleteStream(Stream: TMemoryStream
StartPosition, EndPosition: Integer);
var
P: Pointer;
Count: Integer;
begin
P := Stream.Memory;
Count := Stream.Size;
if Count > EndPosition then
begin
Move(Pointer(Integer(P) + EndPosition)^, Pointer(Integer(P) + StartPosition)^, Count - EndPosition);
Stream.Size := Stream.Size - (EndPosition - StartPosition);
end
else
Stream.Size := StartPosition;
end;
大概是这样吧,随手写的,没调,自己调整吧。
var
SourceSize, DestSize: Integer;
begin
DestSize := Dest.Size;
SourceSize := Source.Size;
Dest.Size := DestSize + SourceSize;
Move(Source.Memory^, Pointer(Integer(Dest.Memory) + DestSize)^, SourceSize)
end;
procedure DeleteStream(Stream: TMemoryStream
StartPosition, EndPosition: Integer);
var
P: Pointer;
Count: Integer;
begin
P := Stream.Memory;
Count := Stream.Size;
if Count > EndPosition then
begin
Move(Pointer(Integer(P) + EndPosition)^, Pointer(Integer(P) + StartPosition)^, Count - EndPosition);
Stream.Size := Stream.Size - (EndPosition - StartPosition);
end
else
Stream.Size := StartPosition;
end;
大概是这样吧,随手写的,没调,自己调整吧。