wx.OutputStream is an abstract base class which may not be used directly.
It is the base class of all streams which provide a Write
function, i.e. which can be used to output data (e.g. to a file, to a socket, etc).
If you want to create your own output stream, you’ll need to derive from this class and implement the protected OnSysWrite
function only.
CountingOutputStream , FFileOutputStream , FileOutputStream , FilterOutputStream , MemoryOutputStream , SocketOutputStream , StringOutputStream , TempFFileOutputStream , TempFileOutputStream
Creates a dummy wx.OutputStream object. |
|
Closes the stream, returning |
|
Returns the number of bytes written during the last |
|
Puts the specified character in the output queue and increments the stream position. |
|
Changes the stream current position. |
|
Returns the current stream position. |
|
Writes up to the specified amount of bytes using the data of buffer. |
|
Writes exactly the specified number of bytes from the buffer. |
|
wx.
OutputStream
(StreamBase)¶Possible constructors:
OutputStream()
OutputStream is an abstract base class which may not be used directly.
__init__
(self)¶Creates a dummy wx.OutputStream object.
Close
(self)¶Closes the stream, returning False
if an error occurs.
The stream is closed implicitly in the destructor if Close
is not called explicitly.
If this stream wraps another stream or some other resource such as a file, then the underlying resource is closed too if it is owned by this stream, or left open otherwise.
bool
LastWrite
(self)¶Returns the number of bytes written during the last Write
.
It may return 0 even if there is no error on the stream if it is only temporarily impossible to write to it.
int
PutC
(self, c)¶Puts the specified character in the output queue and increments the stream position.
c (int) –
SeekO
(self, pos, mode=FromStart)¶Changes the stream current position.
pos (wx.FileOffset) – Offset to seek to.
mode (SeekMode) – One of FromStart, FromEnd, FromCurrent.
wx.FileOffset
The new stream position or InvalidOffset
on error.
TellO
(self)¶Returns the current stream position.
wx.FileOffset
Write
(self, *args, **kw)¶Write (self, buffer, size)
Writes up to the specified amount of bytes using the data of buffer.
Note that not all data can always be written so you must check the number of bytes really written to the stream using LastWrite
when this function returns.
In some cases (for example a write end of a pipe which is currently full) it is even possible that there is no errors and zero bytes have been written. This function returns a reference on the current object, so the user can test any states of the stream right away.
buffer –
size (int) –
Write (self, stream_in)
Reads data from the specified input stream and stores them in the current stream.
The data is read until an error is raised by one of the two streams.
stream_in (wx.InputStream) –
WriteAll
(self, buffer, size)¶Writes exactly the specified number of bytes from the buffer.
Returns True
if exactly size bytes were written. Otherwise, returns False
and LastWrite
should be used to retrieve the exact amount of the data written if necessary.
This method uses repeated calls to Write
(which may return writing only part of the data) if necessary.
buffer –
size (int) –
bool
New in version 2.9.5.
close
(self)¶eof
(self)¶bool
flush
(self)¶seek
(self, offset, whence=0)¶tell
(self)¶wx.FileOffset
write
(self, data)¶PyObject