create custom stream class
create custom stream class
Since streams in wxWidgets seems to be similar to the ones from Java, I was wondering how to make a custom own stream class, like for example DESInputStream, that should decrypt DES data from some wxInputStream. Is there some examples how to do something like that?
Re: create custom stream class
Usually these stream classes derive from wxFilterInputStream and take a wxInputStream as input parameter.
One example would be wxZlibInputStream, its implementation is relatively small and can be seen in <wxdir>/src/common/zstream.cpp
One example would be wxZlibInputStream, its implementation is relatively small and can be seen in <wxdir>/src/common/zstream.cpp
Use the source, Luke!
Re: create custom stream class
OK, so it seems to be really similar to how it´s done in Java. Howewer in Java I have to overwrite read, posiblly some other functions, not shure since it long time ago, but do I have to overwrite some functions to create a custom wxWidgets stream? I gues I have to owerwrite read, but which one?doublemax wrote:Usually these stream classes derive from wxFilterInputStream and take a wxInputStream as input parameter.
One example would be wxZlibInputStream, its implementation is relatively small and can be seen in <wxdir>/src/common/zstream.cpp