stream io note that not all mode combinations make sense and thus some combinations will generate an error in general you don' therefore need to worry about which stream you are using or what that stream doesnot least because all the streams extend the iobase class and thus have common set of methods and attributes howeverit is useful to understand the implications of what you are doing so that you can make better informed choices for examplebinary streams (that do less processingare faster than unicode oriented streams that must convert from ascii into unicode also understanding the role of streams in input and output can also allow you to change the source and destination of data without needing to re-write the whole of your application you can thus use file or stdin for testing and socket for reading data in production online resources see the following online resources for information on the topics in this library guide to the core tools available for working with streams exercise use the underlying streams model to create an application that will write binary data to file you can use the 'bprefix to create binary literal to be writtenfor example 'hello worldnext create another application to reload the binary data from the file and print it out