We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cfc54a5 + eaa9139 commit f761339Copy full SHA for f761339
src/main/java/com/microsoft/graph/models/extensions/Multipart.java
@@ -135,8 +135,12 @@ private byte[] getByteArray(InputStream in) throws IOException {
135
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
136
int nRead;
137
byte[] data = new byte[16384];
138
- while ((nRead = in.read(data, 0, data.length)) != -1) {
139
- buffer.write(data, 0, nRead);
+ try {
+ while ((nRead = in.read(data, 0, data.length)) != -1) {
140
+ buffer.write(data, 0, nRead);
141
+ }
142
+ } finally {
143
+ in.close();
144
}
145
buffer.flush();
146
return buffer.toByteArray();
0 commit comments