Paul Ishenin wrote:
Michael Van Canneyt wrote:
And writing ?
Silently do nothing:
procedure TForm4.Button1Click(Sender: TObject);
var
S: TMemoryStream;
B: Byte;
Count: Integer;
begin
S := TMemoryStream.Create;
S.Position := -1;
B := 1;
S.Write(B, SizeOf(B));
On Thu, 1 Jan 2009, Paul Ishenin wrote:
Michael Van Canneyt wrote:
If you do an exception or silent change of position it can cause
incompatibilities. Maybe read operation must be fixed to ignore positions
out
of the range 0..Size -1?
What does Delphi do in such a case
Michael Van Canneyt wrote:
And writing ?
Silently do nothing:
procedure TForm4.Button1Click(Sender: TObject);
var
S: TMemoryStream;
B: Byte;
Count: Integer;
begin
S := TMemoryStream.Create;
S.Position := -1;
B := 1;
S.Write(B, SizeOf(B));
ShowMessage(IntToStr(S.Size));
S.Free;
end;
While finding the bug #12897 I found that a memory stream position could
be set to before the start of the file without giving an error, and
subsequent reads would appear to work (unless the position was so far
off an invalid region of memory was read). I found the precise problem
by patching
On Thu, 1 Jan 2009, C Western wrote:
While finding the bug #12897 I found that a memory stream position could
be set to before the start of the file without giving an error, and
subsequent reads would appear to work (unless the position was so far
off an invalid region of memory was read).
Michael Van Canneyt wrote:
While finding the bug #12897 I found that a memory stream position could
be set to before the start of the file without giving an error, and
subsequent reads would appear to work (unless the position was so far
off an invalid region of memory was read). I found the
On Thu, 1 Jan 2009, Paul Ishenin wrote:
Michael Van Canneyt wrote:
While finding the bug #12897 I found that a memory stream position could
be set to before the start of the file without giving an error, and
subsequent reads would appear to work (unless the position was so far
off
Michael Van Canneyt wrote:
On Thu, 1 Jan 2009, Paul Ishenin wrote:
Michael Van Canneyt wrote:
While finding the bug #12897 I found that a memory stream position could
be set to before the start of the file without giving an error, and
subsequent reads would appear to work (unless the
Michael Van Canneyt wrote:
If you do an exception or silent change of position it can cause
incompatibilities. Maybe read operation must be fixed to ignore positions out
of the range 0..Size -1?
What does Delphi do in such a case ?
Tested so:
procedure TForm1.Button1Click(Sender: