Search in sources :

Example 26 with HexDumpEncoder

use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.

the class Debug method printHex.

static void printHex(String prefix, byte[] bytes) {
    HexDumpEncoder dump = new HexDumpEncoder();
    synchronized (System.out) {
        System.out.println(prefix);
        try {
            dump.encodeBuffer(bytes, System.out);
        } catch (Exception e) {
        // ignore
        }
        System.out.flush();
    }
}
Also used : HexDumpEncoder(sun.security.util.HexDumpEncoder)

Example 27 with HexDumpEncoder

use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.

the class Debug method printHex.

static void printHex(String prefix, byte[] bytes, int offset, int length) {
    HexDumpEncoder dump = new HexDumpEncoder();
    synchronized (System.out) {
        System.out.println(prefix);
        try {
            ByteBuffer bb = ByteBuffer.wrap(bytes, offset, length);
            dump.encodeBuffer(bb, System.out);
        } catch (Exception e) {
        // ignore
        }
        System.out.flush();
    }
}
Also used : HexDumpEncoder(sun.security.util.HexDumpEncoder) ByteBuffer(java.nio.ByteBuffer)

Aggregations

HexDumpEncoder (sun.security.util.HexDumpEncoder)27 IOException (java.io.IOException)8 ByteArrayInputStream (java.io.ByteArrayInputStream)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 CRLException (java.security.cert.CRLException)2 PRF (sun.security.ssl.CipherSuite.PRF)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ByteBuffer (java.nio.ByteBuffer)1 InvalidKeyException (java.security.InvalidKeyException)1 NoSuchProviderException (java.security.NoSuchProviderException)1 SignatureException (java.security.SignatureException)1 CertificateException (java.security.cert.CertificateException)1 Extension (java.security.cert.Extension)1 X509CRLEntry (java.security.cert.X509CRLEntry)1 ArrayList (java.util.ArrayList)1