Java serialization, ObjectInputStream.readObject(), check if will block

No. Although you could use the ObjectInputStream in another thread and check to see whether that has an object available. Generally polling isn’t a great idea, particularly with the poor guarantees of InputStream.available.

Leave a Comment