io
StreamHandle
Bases: str
This is either obtained from another method or specified as blob:<uuid>
where
<uuid>
is an UUID of a Blob.
Source code in zendriver/cdp/io.py
__repr__()
from_json(json)
classmethod
close(handle)
Close the stream, discard any temporary backing storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handle
|
StreamHandle
|
Handle of the stream to close. |
required |
Source code in zendriver/cdp/io.py
read(handle, offset=None, size=None)
Read a chunk of the stream
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handle
|
StreamHandle
|
Handle of the stream to read. |
required |
offset
|
Optional[int]
|
(Optional) Seek to the specified offset before reading (if not specified, proceed with offset following the last read). Some types of streams may only support sequential reads. |
None
|
size
|
Optional[int]
|
(Optional) Maximum number of bytes to read (left upon the agent discretion if not specified). |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[bool], str, bool]]
|
A tuple with the following items: 0. base64Encoded - (Optional) Set if the data is base64-encoded 1. data - Data that were read. 2. eof - Set if the end-of-file condition occurred while reading. |
Source code in zendriver/cdp/io.py
resolve_blob(object_id)
Return UUID of Blob object specified by a remote object id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
RemoteObjectId
|
Object id of a Blob object wrapper. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, str]
|
UUID of the specified Blob. |