cleanup per jikes' whining (overloaded var names, val overflow, etc)

This commit is contained in:
jrandom
2004-09-23 01:13:22 +00:00
committed by zzz
parent 3bb85f2d61
commit 7c1ce777a1
4 changed files with 22 additions and 24 deletions

View File

@ -33,7 +33,6 @@ import net.i2p.util.Log;
* @author jrandom
*/
class RequestLeaseSetMessageHandler extends HandlerImpl {
private final static Log _log = new Log(RequestLeaseSetMessageHandler.class);
private Map _existingLeaseSets;
public RequestLeaseSetMessageHandler(I2PAppContext context) {

View File

@ -377,12 +377,12 @@ public class AESInputStream extends FilterInputStream {
long endE = Clock.getInstance().now();
ByteArrayInputStream encryptedStream = new ByteArrayInputStream(encrypted);
AESInputStream in = new AESInputStream(ctx, encryptedStream, key, iv);
AESInputStream sin = new AESInputStream(ctx, encryptedStream, key, iv);
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
byte buf[] = new byte[1024 * 32];
int read = DataHelper.read(in, buf);
int read = DataHelper.read(sin, buf);
if (read > 0) baos.write(buf, 0, read);
in.close();
sin.close();
byte fin[] = baos.toByteArray();
long end = Clock.getInstance().now();
Hash origHash = SHA256Generator.getInstance().calculateHash(orig);
@ -422,15 +422,15 @@ public class AESInputStream extends FilterInputStream {
System.arraycopy(encrypted, 0, encryptedSegment, 0, 40);
ByteArrayInputStream encryptedStream = new ByteArrayInputStream(encryptedSegment);
AESInputStream in = new AESInputStream(ctx, encryptedStream, key, iv);
AESInputStream sin = new AESInputStream(ctx, encryptedStream, key, iv);
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
byte buf[] = new byte[1024 * 32];
int read = DataHelper.read(in, buf);
int remaining = in.remainingBytes();
int readyBytes = in.readyBytes();
int read = DataHelper.read(sin, buf);
int remaining = sin.remainingBytes();
int readyBytes = sin.readyBytes();
log.info("Read: " + read);
if (read > 0) baos.write(buf, 0, read);
in.close();
sin.close();
byte fin[] = baos.toByteArray();
log.info("fin.length: " + fin.length + " remaining: " + remaining + " ready: " + readyBytes);
long end = Clock.getInstance().now();

View File

@ -447,19 +447,18 @@ public class LogManager {
if (!Character.isDigit(mod)) v = size.substring(0, size.length() - 1);
int val = Integer.parseInt(v);
switch (mod) {
case 'K':
val *= 1024;
break;
case 'M':
val *= 1024 * 1024;
break;
case 'G':
val *= 1024 * 1024 * 1024;
break;
case 'T':
// because we can
val *= 1024 * 1024 * 1024 * 1024;
break;
case 'K':
val *= 1024;
break;
case 'M':
val *= 1024 * 1024;
break;
case 'G':
val *= 1024 * 1024 * 1024;
break;
default:
// blah, noop
break;
}
return val;
} catch (Throwable t) {

View File

@ -104,6 +104,8 @@ public class ShellCommand {
}
}
private final static int BUFFER_SIZE = 1024;
/**
* Reads data from a <code>java.io.InputStream</code> and writes it to
* <code>STDOUT</code>.
@ -112,8 +114,6 @@ public class ShellCommand {
*/
private class StreamReader extends Thread {
final int BUFFER_SIZE = 1024;
private BufferedReader bufferedReader;
private InputStreamReader inputStreamReader;