Clean up single char indexOf()

This commit is contained in:
zzz
2016-12-03 16:00:09 +00:00
parent f461d4881d
commit 42efed578a
16 changed files with 42 additions and 101 deletions

View File

@@ -210,10 +210,7 @@ public class Reseeder {
tmp = new File(_context.getTempDir(), "manualreseeds-" + _context.random().nextInt() + (isSU3 ? ".su3" : ".zip"));
out = new BufferedOutputStream(new SecureFileOutputStream(tmp));
out.write(magic);
byte buf[] = new byte[16*1024];
int read = 0;
while ( (read = in.read(buf)) != -1)
out.write(buf, 0, read);
DataHelper.copy(in, out);
out.close();
int[] stats;
ReseedRunner reseedRunner = new ReseedRunner();

View File

@@ -430,11 +430,7 @@ public class WorkingDir {
try {
in = new FileInputStream(src);
out = new SecureFileOutputStream(dst);
int read = 0;
while ( (read = in.read(buf)) != -1)
out.write(buf, 0, read);
DataHelper.copy(in, out);
System.err.println("Copied " + src.getPath());
} catch (IOException ioe) {
System.err.println("FAILED copy " + src.getPath() + ": " + ioe);