|
@@ -287,13 +287,16 @@ begin
|
|
begin
|
|
begin
|
|
if (a_length > -1) then
|
|
if (a_length > -1) then
|
|
begin
|
|
begin
|
|
-
|
|
|
|
if ((a_stream.Position + a_length) > a_stream.Size) then
|
|
if ((a_stream.Position + a_length) > a_stream.Size) then
|
|
|
|
+ begin
|
|
raise EIndexOutOfRangeHashLibException.CreateRes(@SIndexOutOfRange);
|
|
raise EIndexOutOfRangeHashLibException.CreateRes(@SIndexOutOfRange);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
if (a_stream.Position >= a_stream.Size) then
|
|
if (a_stream.Position >= a_stream.Size) then
|
|
|
|
+ begin
|
|
Exit;
|
|
Exit;
|
|
|
|
+ end;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
@@ -365,7 +368,9 @@ begin
|
|
System.Assert((a_length = -1) or (a_length > 0));
|
|
System.Assert((a_length = -1) or (a_length > 0));
|
|
{$ENDIF DEBUG}
|
|
{$ENDIF DEBUG}
|
|
if not FileExists(a_file_name) then
|
|
if not FileExists(a_file_name) then
|
|
|
|
+ begin
|
|
raise EArgumentHashLibException.CreateRes(@SFileNotExist);
|
|
raise EArgumentHashLibException.CreateRes(@SFileNotExist);
|
|
|
|
+ end;
|
|
|
|
|
|
MyFileStream := TFileStream.Create(a_file_name, fmOpenRead or
|
|
MyFileStream := TFileStream.Create(a_file_name, fmOpenRead or
|
|
fmShareDenyWrite);
|
|
fmShareDenyWrite);
|