Skip to content

Commit 3826460

Browse files
author
Benjamin Moody
committed
New module wfdb.io._url.
This module contains functions and classes for accessing remote files via HTTP. The RangeTransfer class provides an efficient interface for requesting and retrieving a range of bytes from a remote file, without knowing in advance if the server supports random access. The NetFile class implements a standard "buffered binary file" (BufferedIOBase) object that is accessed via HTTP. This class implements its own buffering, rather than implementing the RawIOBase API and using a BufferedReader, because the buffering behavior depends on the server (if the server doesn't support random access, we want to buffer the entire file at once.) We also want to enable a mode where the entire file is explicitly buffered in advance, which may be more efficient when the caller intends to read the entire file. The openurl function provides an open-like API for creating either a text or binary file object.
1 parent ae67d09 commit 3826460

1 file changed

Lines changed: 736 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)