maxon.BaseStreamInterface¶
Description¶
Attributes¶
Methods Signature¶
  | 
Closes the stream.  | 
The stream may disable buffering when this routine is called (if it supports it). 
 | 
|
Returns the current stream position. 
 | 
|
Returns the length of the stream/file. 
 | 
|
  | 
Sets the read/write position to this absolute position from the beginning of the stream.  | 
Returns if the stream supports   | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Methods Definition¶
- 
BaseStreamInterface.Close()¶ Closes the stream.
- 
BaseStreamInterface.DisableBuffering()¶ - The stream may disable buffering when this routine is called (if it supports it).This method is typically used when the buffering is done from the outside.
 
- 
BaseStreamInterface.GetPosition()¶ - Returns the current stream position.This is the position where the next bytes will be read to or written from.
- Returns
 The current stream position.
- Return type
 int
 
- 
BaseStreamInterface.GetStreamLength()¶ - Returns the length of the stream/file.Be aware that some streams cannot return the file size (e.g. http streams with gzip+chunked transfer encoding).With this example code you can handle both cases correctly.In most cases it’s better to not use
maxon.BaseStreamInterface.GetStreamLength()and better usemaxon.InputStreamInterface.ReadEOS()to read as much as available.- Return type
 Returns the length in bytes.
- Return type
 int
 
- 
BaseStreamInterface.Seek(position)¶ Sets the read/write position to this absolute position from the beginning of the stream.
Note
For
maxon.InputStreamInterface: If you want toBaseStreamInterface.Seek()forwardInputStreamInterface.Skip()is the preferred method to call from the performance perspective.- Parameters
 position (int) – Position to jump to within the stream.
- 
BaseStreamInterface.SeekSupported()¶ Returns if the stream supports
BaseStreamInterface.Seek().Note
Seeking in stream may effect performance because the caches will be flushed.
- Returns
 True if the output stream supports
BaseStreamInterface.Seek().- Return type
 bool
- 
BaseStreamInterface.__enter__()¶ 
- 
BaseStreamInterface.__exit__(exc_type, exc_value, traceback)¶ 
- 
BaseStreamInterface.close()¶ 
- 
BaseStreamInterface.seek(offset, whence=0)¶ 
- 
BaseStreamInterface.seekable()¶ 
- 
BaseStreamInterface.tell()¶