## wxInputStream

wxInputStream is an abstract base class which may not be used directly.

Derived from

wxStreamBase

Include files

<wx/stream.h>

Members

wxInputStream::wxInputStream
wxInputStream::~wxInputStream
wxInputStream::GetC
wxInputStream::Eof
wxInputStream::LastRead
wxInputStream::Peek
wxInputStream::Read
wxInputStream::SeekI
wxInputStream::TellI
wxInputStream::Ungetch

### wxInputStream::wxInputStream

wxInputStream()

Creates a dummy input stream.

### wxInputStream::~wxInputStream

~wxInputStream()

Destructor.

### wxInputStream::GetC

char GetC()

Returns the first character in the input queue and removes it.

### wxInputStream::Eof

wxInputStream Eof() const

Returns TRUE if the end of stream has been reached.

### wxInputStream::LastRead

size_t LastRead() const

Returns the last number of bytes read.

### wxInputStream::Peek

char Peek()

Returns the first character in the input queue without removing it.

### wxInputStream::Read

wxInputStream& Read(void *buffer, size_t size)

Reads the specified amount of bytes and stores the data in buffer.

Warning

The buffer absolutely needs to have at least the specified size.

Return value

This function returns a reference on the current object, so the user can test any states of the stream right away.

wxInputStream& Read(wxOutputStream& stream_out)

Reads data from the input queue and stores it in the specified output stream. The data is read until an error is raised by one of the two streams.

Return value

This function returns a reference on the current object, so the user can test any states of the stream right away.

### wxInputStream::SeekI

off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart)

Changes the stream current position.

### wxInputStream::TellI

off_t TellI() const

Returns the current stream position.

### wxInputStream::Ungetch

size_t Ungetch(const char* buffer, size_t size)

This function is only useful in read mode. It is the manager of the "Write-Back" buffer. This buffer acts like a temporary buffer where datas which has to be read during the next read IO call are put. This is useful when you get a big block of data which you didn't want to read: you can replace them at the top of the input queue by this way.

Be very careful about this call in connection with calling SeekI() on the same stream. Any call to SeekI() will invalidate any previous call to this method (otherwise you could SeekI() to one position, "unread" a few bytes there, SeekI() to another position and data would be either lost or corrupted).

Return value

Returns the amount of bytes saved in the Write-Back buffer.

bool Ungetch(char c)

This function acts like the previous one except that it takes only one character: it is sometimes shorter to use than the generic function.