You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int read;
while ( ( read = r.read() ) != -1 )
{
byteArrayOutputStream.write( read );
}
A reader (always char-oriented) returns chars (which are compatible with ints) but the stream expects bytes. If a char is bigger than a byte, information is lost.