This content has been marked as final. Show 2 replies
You can't know how many bytes you will read from an InputStream, in general, until you read them. It's possible that a particular subclass could give you this information but you can't expect all subclasses to do that.
If you're asking because you need a number to give to PreparedStatement.setBinaryStream, have you tried passing zero for that parameter? Or Integer.MAX_VALUE?