mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-25 17:36:55 +01:00
Fix the buffer size in the getBytesFromStream function
This commit is contained in:
parent
a5bc706cb9
commit
31fcc4fc6d
@ -35,7 +35,12 @@ public final class StreamUtils {
|
||||
public static byte[] getBytesFromStream(InputStream in, int size) throws IOException {
|
||||
synchronized (in) {
|
||||
byte[] result = new byte[size];
|
||||
byte[] buffer = new byte[0x8000];
|
||||
byte[] buffer = null;
|
||||
if (size < 0x8000) {
|
||||
buffer = new byte[size];
|
||||
} else {
|
||||
buffer = new byte[0x8000];
|
||||
}
|
||||
int totalRead = 0;
|
||||
do {
|
||||
int read = in.read(buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user