# io.RawIOBase.read ()

### io.RawIOBase.read ( *size=-1* )

Читает ***size*** байтов из объекта и возвращает их. Для удобства, если размер не указан или -1, возвращаются все байты до EOF. В противном случае выполняется только один системный вызов. Байт меньше ***size*** может быть возвращено, если вызов операционной системы возвращает меньше, чем ***size*** байтов.

Если возвращается 0 байт и размер не равен 0, это означает конец файла. Если объект находится в неблокирующем режиме и нет доступных байтов, возвращается `None`.

Реализация по умолчанию полагается на [readall ()](/python-docs/moduli-standartnoi-biblioteki-1/obshie-sluzhby-operacionnoi-sistemy/io/io.rawiobase/io.rawiobase.readall.md) и [readinto ()](/python-docs/moduli-standartnoi-biblioteki-1/obshie-sluzhby-operacionnoi-sistemy/io/io.rawiobase/io.rawiobase.readinto.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://treasuremaster.gitbook.io/python-docs/moduli-standartnoi-biblioteki-1/obshie-sluzhby-operacionnoi-sistemy/io/io.rawiobase/io.rawiobase.read.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
