posted 6 years ago
Are CvDAO and UserDAO your own classes? Because I'll tell you this: -1 is a perfect valid return value for the read methods of both InputStream and Reader. It indicates that all data has been read, and it's by no means an error. Well, unless you expected more data, in which case an EOFException is the best exception to throw.