Streams and errors


#1

Is there a way to check an InputStream or OutputStream for error when using the Byte, Short, Int versions of read and write.

Supposing im writing to a stream, my last call is `st.writeInt(val);’ how can i know i’m ok. the same goes for the InputStream. For example may i can check using bool v = st.write(0, 0). or something?


#2

No, those methods are a bit lacking in error detection, I’m afraid. Although if you use read() or write() directly, then they return the number of bytes written, so you can check the size.