Skip to content

Commit

Permalink
TFileStream => TBufferedFileStream (why not?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pozitronik authored and Pozitronik committed May 20, 2019
1 parent 3adcd2d commit 4c73457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ChunkedFileStream.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface
TChunkedFileStream = class(TStream)
private
FStartPos, FSize: Int64;
FileStream: TFileStream;
FileStream: TBufferedFileStream;
protected
function GetSize(): Int64; override;
public
Expand All @@ -32,7 +32,7 @@ constructor TChunkedFileStream.Create(const AFileName: string; Mode: Word; Chunk
FileSize: Int64;
begin
inherited Create;
self.FileStream := TFileStream.Create(AFileName, Mode);
self.FileStream := TBufferedFileStream.Create(AFileName, Mode);
FileSize := FileStream.Size;
if (ChunkSize < 0) or (ChunkSize > FileSize) or (ChunkStart < 0) or (ChunkStart > FileSize) or (FileStream.Seek(ChunkStart, soBeginning) <> ChunkStart) then
raise EReadError.Create('Can''t read from ' + AFileName + ' ' + ChunkSize.ToString + ' bytes at ' + ChunkStart.ToString);
Expand Down

0 comments on commit 4c73457

Please sign in to comment.