Core: misc. minor changes

This commit is contained in:
zzz
2018-06-26 20:29:19 +00:00
parent baa11d8146
commit ef7b3e0c8b
6 changed files with 34 additions and 13 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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());
}
}