How can I get an ObjectInputStream that supports mark/reset?
问题 I'm trying to get an ObjectInputStream that will allow me to read data from it and, if it's not of the right type, put the data back onto the stream (using mark and reset ) for some other code to deal with. I've tried wrapping the InputStream retrieved from the Socket ( s in the following example) in a BufferedInputStream before wrapping it in an ObjectInputStream as I believed to be the solution, however when calling ois.markSupported() false is still returned. Below is that attempt: ois =