forked from I2P_Developers/i2p.i2p
Core: misc. minor changes
This commit is contained in:
@@ -27,6 +27,7 @@ public class HexDump {
|
||||
|
||||
private static final int FORMAT_OFFSET_PADDING = 8;
|
||||
private static final int FORMAT_BYTES_PER_ROW = 16;
|
||||
private static final int OUTPUT_BYTES_PER_ROW = 79;
|
||||
private static final byte[] HEXCHARS = DataHelper.getASCII("0123456789abcdef");
|
||||
|
||||
/**
|
||||
@@ -35,14 +36,7 @@ public class HexDump {
|
||||
* @param data Data to be dumped
|
||||
*/
|
||||
public static String dump(byte[] data) {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
try {
|
||||
dump(data, 0, data.length, out);
|
||||
return out.toString("ISO-8859-1");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("no 8859?", e);
|
||||
}
|
||||
return dump(data, 0, data.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +47,8 @@ public class HexDump {
|
||||
* @param len Number of bytes of <code>data</code> to be dumped
|
||||
*/
|
||||
public static String dump(byte[] data, int off, int len) {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int outlen = OUTPUT_BYTES_PER_ROW * (len + FORMAT_BYTES_PER_ROW - 1) / FORMAT_BYTES_PER_ROW;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream(outlen);
|
||||
|
||||
try {
|
||||
dump(data, off, len, out);
|
||||
|
||||
@@ -144,6 +144,7 @@ public class I2PSSLSocketFactory {
|
||||
/**
|
||||
* We exclude everything that Java 8 disables by default, plus some others.
|
||||
* ref: http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html
|
||||
* See also: https://developer.android.com/reference/javax/net/ssl/SSLSocket.html
|
||||
* Unmodifiable.
|
||||
* Public for RouterConsoleRunner.
|
||||
* @since 0.9.16
|
||||
|
||||
@@ -340,12 +340,12 @@ public abstract class SystemVersion {
|
||||
System.out.println("GNU : " + isGNU());
|
||||
System.out.println("Linux Svc: " + isLinuxService());
|
||||
System.out.println("Mac : " + isMac());
|
||||
System.out.println("Max mem : " + getMaxMemory());
|
||||
System.out.println("OpenJDK : " + isOpenJDK());
|
||||
System.out.println("Slow : " + isSlow());
|
||||
System.out.println("Windows : " + isWindows());
|
||||
System.out.println("Wrapper : " + hasWrapper());
|
||||
System.out.println("x86 : " + isX86());
|
||||
System.out.println("Max mem : " + getMaxMemory());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user