5from typing
import Union, Optional
12 def __init__(self, filepath: str, mode: Optional[str] =
None) ->
None:
15 self.
fh = open(filepath, mode)
17 self.
fh = open(filepath,
"rb")
25 def read(self, numBytes: int = 0) -> str:
27 return self.fh.
read(numBytes)
30 def readBytes(self, numBytes: int = 0) -> bytearray:
32 return bytearray(self.
fh.
read(numBytes))
33 return bytearray(self.
fh.
read())
35 def write(self, buffer: Union[str, bytes, bytearray]) -> bool:
41 def seek(self, seekBytes: int, iWhence: int = 0) -> int:
42 return self.
fh.
seek(seekBytes, iWhence);
53 return os.path.isfile(path)
str read(self, int numBytes=0)
None __init__(self, str filepath, Optional[str] mode=None)
int seek(self, int seekBytes, int iWhence=0)
bool write(self, Union[str, bytes, bytearray] buffer)
bytearray readBytes(self, int numBytes=0)
def __exit__(self, exc_type, exc_val, exc_tb)
str translatePath(str path)