Skip to content

Commit 2140ce6

Browse files
committed
unify indent of java code
1 parent 1f2350d commit 2140ce6

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

android/src/main/java/com/rnziparchive/StreamUtil.java

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,31 @@
77
import static com.facebook.common.internal.Preconditions.checkNotNull;
88

99
public class StreamUtil {
10-
private static final int BUF_SIZE = 0x1000; // 4K
10+
private static final int BUF_SIZE = 0x1000; // 4K
1111

12-
public interface ProgressCallback {
13-
// not the total - the actual number read since last time
14-
void onCopyProgress(long bytesRead);
15-
}
12+
public interface ProgressCallback {
13+
// not the total - the actual number read since last time
14+
void onCopyProgress(long bytesRead);
15+
}
1616

17-
// https://stackoverflow.com/questions/4919690/how-to-read-one-stream-into-another
18-
public static long copy(InputStream from, OutputStream to, ProgressCallback callback)
19-
throws IOException {
20-
checkNotNull(from);
21-
checkNotNull(to);
22-
byte[] buf = new byte[BUF_SIZE];
23-
long total = 0;
24-
while (true) {
25-
int r = from.read(buf);
26-
if (r == -1) {
27-
break;
28-
}
29-
to.write(buf, 0, r);
30-
total += r;
17+
// https://stackoverflow.com/questions/4919690/how-to-read-one-stream-into-another
18+
public static long copy(InputStream from, OutputStream to, ProgressCallback callback) throws IOException {
19+
checkNotNull(from);
20+
checkNotNull(to);
21+
byte[] buf = new byte[BUF_SIZE];
22+
long total = 0;
23+
while (true) {
24+
int r = from.read(buf);
25+
if (r == -1) {
26+
break;
27+
}
28+
to.write(buf, 0, r);
29+
total += r;
3130

32-
if (callback != null) {
33-
callback.onCopyProgress(r);
34-
}
35-
}
36-
return total;
31+
if (callback != null) {
32+
callback.onCopyProgress(r);
33+
}
3734
}
35+
return total;
36+
}
3837
}

0 commit comments

Comments
 (0)