User Tools

Site Tools


api:dk11:delphi:gisstreams.tgis_stream.readbytessafe_tbytes_integer

Table of Contents

TGIS_Stream.ReadBytesSafe method

DK11 for Delphi | GisStreams.TGIS_Stream.ReadBytesSafe | Constructors | Methods | Properties

Read array of bytes

Available also on: .NET | Java.

Syntax

// Delphi
public
  function ReadBytesSafe(
    var _buf : TBytes;
    const _count : Integer
  ) : Integer;
// C++ Builder
public:
  int ReadBytesSafe(
    TBytes* &_buf,
    const int _count
  );

Parameters

Name Type Description
_buf TBytes array of bytes; buffer will be automatically allocated
_count Integer number of bytes to be read

Result

Type Description
Integer Number of read bytes.

Example

Delphi

var
  strm : TGIS_MappedStream ;
  ar   : TBytes ;
begin
  strm := TGIS_MappedStream.Create( 'myfile.bin', False);
  strm.ReadBytesSafe( ar, 2048 ) ;
 
  dosomething();
end;
2020/05/07 01:10

Page Tools