Skip readStream optimization for compatibility with misbehaving InputStreams

Closes gh-27429
This commit is contained in:
Juergen Hoeller 2021-09-21 17:41:56 +02:00
parent 09a1b87d37
commit eabe946a53
1 changed files with 3 additions and 1 deletions

View File

@ -324,7 +324,9 @@ public class ClassReader {
} }
outputStream.flush(); outputStream.flush();
if (readCount == 1) { if (readCount == 1) {
return data; // SPRING PATCH: some misbehaving InputStreams return -1 but still write to buffer (gh-27429)
// return data;
// END OF PATCH
} }
return outputStream.toByteArray(); return outputStream.toByteArray();
} finally { } finally {