Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 848 Bytes

TPJMD5-ReadBufferSize.md

File metadata and controls

38 lines (27 loc) · 848 Bytes

ReadBufferSize property

Project: MD5 Message Digest Unit

Unit: PJMD5

Class: TPJMD5

Applies to: ~>1.0

property ReadBufferSize: Cardinal;

Description

TPJMD5 buffers data read from streams and files. The size of the buffer is customisable. Read this property to find the buffer size in bytes. Set the property to change the buffer size.

The default buffer size is specified by the DefReadBufferSize class constant.

Example

The following code reads data from a file in 1Kb chunks:

var
  MD5: TPJMD5;
begin
  MD5 := TPJMD5.Create;
  try
    MD5.ReadBufferSize := 1024;
    MD5.ProcessFile('MyFile1.txt');
    ShowMessage(MD5.Digest); // Digest implicitly cast to string
  finally
    MD5.Free;
  end;
end;