Update #24 - 1000s of optimizations, shared worlds on desktop

This commit is contained in:
lax1dude
2024-03-02 20:51:44 -08:00
parent a50c93cb75
commit 8ab65942c5
624 changed files with 8091 additions and 3620 deletions

View File

@ -71,4 +71,19 @@ public class IOUtils {
}
}
public static int readFully(InputStream is, byte[] out) throws IOException {
int i = 0, j;
while(i < out.length && (j = is.read(out, i, out.length - i)) != -1) {
i += j;
}
return i;
}
public static long skipFully(InputStream is, long skip) throws IOException {
long i = 0, j;
while(i < skip && (j = is.skip(skip - i)) != 0) {
i += j;
}
return i;
}
}