ooodev.adapter.io.input_stream_partial module
- class ooodev.adapter.io.input_stream_partial.InputStreamPartial(component, interface=com.sun.star.io.XInputStream)[source]
Bases:
object
Partial Class XInputStream.
- Parameters:
component (XInputStream) –
interface (UnoInterface | None) –
- __init__(component, interface=com.sun.star.io.XInputStream)[source]
Constructor
- Parameters:
component (XInputStream) – UNO Component that implements
com.sun.star.io.XInputStream
interface.interface (UnoInterface, optional) – The interface to be validated. Defaults to
XInputStream
.
- Return type:
None
- available()[source]
states how many bytes can be read or skipped without blocking.
Note: This method offers no information on whether the EOF has been reached.
- Raises:
com.sun.star.io.NotConnectedException –
NotConnectedException
com.sun.star.io.IOException –
IOException
- Return type:
int
- close_input()[source]
closes the stream.
Users must close the stream explicitly when no further reading should be done. (There may exist ring references to chained objects that can only be released during this call. Thus not calling this method would result in a leak of memory or external resources.)
- Raises:
com.sun.star.io.NotConnectedException –
NotConnectedException
com.sun.star.io.IOException –
IOException
- Return type:
None
- read_bytes(num_bytes)[source]
Reads the specified number of bytes in the given sequence.
The return value specifies the number of bytes which have been put into the sequence. A difference between nBytesToRead and the return value indicates that EOF has been reached. This means that the method blocks until the specified number of bytes are available or the EOF is reached.
- Parameters:
num_bytes (int) – The number of bytes to read.
- Raises:
com.sun.star.io.NotConnectedException –
NotConnectedException
com.sun.star.io.BufferSizeExceededException –
BufferSizeExceededException
com.sun.star.io.IOException –
IOException
- Return type:
Tuple
[int
,Tuple
[int
]]
- read_some_bytes(max_read)[source]
Reads the available number of bytes, at maximum nMaxBytesToRead.
This method is very similar to the readBytes method, except that it has different blocking behaviour. The method blocks as long as at least 1 byte is available or EOF has been reached. EOF has only been reached, when the method returns
0
and the corresponding byte sequence is empty. Otherwise, after the call, aData contains the available, but no more than nMaxBytesToRead, bytes.- Parameters:
max_read (int) – The maximum number of bytes to read.
- Raises:
com.sun.star.io.NotConnectedException –
NotConnectedException
com.sun.star.io.BufferSizeExceededException –
BufferSizeExceededException
com.sun.star.io.IOException –
IOException
- Return type:
Tuple
[int
,Tuple
[int
]]
- skip_bytes(skip_num)[source]
Skips the next skip_num bytes (must be positive).
It is up to the implementation whether this method is blocking the thread or not.
- Raises:
com.sun.star.io.NotConnectedException –
NotConnectedException
com.sun.star.io.BufferSizeExceededException –
BufferSizeExceededException
com.sun.star.io.IOException –
IOException
- Return type:
None
- Parameters:
skip_num (int) –