[#BloombergLP-bdls-FilesystemUtil-read]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::read
:relfileprefix: ../../../
:mrdocs:

Read `numBytes` from the file with `descriptor` into `buffer`&period;

== Synopsis

Declared in `&lt;bdls&lowbar;filesystemutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
read(
    xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] descriptor,
    void* buffer,
    int numBytes);
----

== Description

Read the specified `numBytes` bytes beginning at the file pointer of the file with the specified `descriptor` into the specified `buffer`&period; Return `numBytes` on success&semi; the number of bytes read if there were not enough available&semi; or a negative number on some other error&period;

== Return Value

`numBytes` on success&semi; the number of bytes read if fewer were available&semi; or a negative number on error

== Parameters

[cols="1,4"]
|===
| Name| Description
| *descriptor*
| file descriptor of the file to read
| *buffer*
| buffer into which bytes are read
| *numBytes*
| number of bytes to read
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
