Skip to content

Commit c4f1e08

Browse files
committed
fixed mistake write for load stream
1 parent c1a820e commit c4f1e08

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/qiniu/ip17mon/Locator.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,7 @@ public static Locator loadFromLocal(String filePath) throws IOException {
155155
public static Locator loadFromStream(InputStream in) throws Exception {
156156
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
157157
byte[] buffer = new byte[16 * 1024];
158-
while (in.read(buffer) != -1) {
159-
byteArrayOutputStream.write(buffer);
160-
}
161-
162-
int n = 0;
158+
int n;
163159

164160
while ((n = in.read(buffer)) != -1) {
165161
byteArrayOutputStream.write(buffer, 0, n);

0 commit comments

Comments
 (0)