当前位置: 首页>>代码示例>>Java>>正文


Java HexDumpEncoder.encodeBuffer方法代码示例

本文整理汇总了Java中sun.misc.HexDumpEncoder.encodeBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java HexDumpEncoder.encodeBuffer方法的具体用法?Java HexDumpEncoder.encodeBuffer怎么用?Java HexDumpEncoder.encodeBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.misc.HexDumpEncoder的用法示例。


在下文中一共展示了HexDumpEncoder.encodeBuffer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readFully

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
private int readFully(InputStream s, byte b[], int off, int len)
        throws IOException {
    int n = 0;
    while (n < len) {
        int readLen = s.read(b, off + n, len - n);
        if (readLen < 0) {
            return readLen;
        }

        if (debug != null && Debug.isOn("packet")) {
            try {
                HexDumpEncoder hd = new HexDumpEncoder();
                ByteBuffer bb = ByteBuffer.wrap(b, off + n, readLen);

                System.out.println("[Raw read]: length = " +
                    bb.remaining());
                hd.encodeBuffer(bb, System.out);
            } catch (IOException e) { }
        }

        n += readLen;
        exlen += readLen;
    }

    return n;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:InputRecord.java

示例2: dumpPacket

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
private void dumpPacket(EngineArgs ea, boolean hsData) {
    try {
        HexDumpEncoder hd = new HexDumpEncoder();

        ByteBuffer bb = ea.netData.duplicate();

        int pos = bb.position();
        bb.position(pos - ea.deltaNet());
        bb.limit(pos);

        System.out.println("[Raw write" +
            (hsData ? "" : " (bb)") + "]: length = " +
            bb.remaining());
        hd.encodeBuffer(bb, System.out);
    } catch (IOException e) { }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:EngineWriter.java

示例3: toString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
public String toString() {
    HexDumpEncoder hexDump = new HexDumpEncoder();

    String out = "";

    out += "Signer Info for (issuer): " + issuerName + "\n";
    out += "\tversion: " + Debug.toHexString(version) + "\n";
    out += "\tcertificateSerialNumber: " +
           Debug.toHexString(certificateSerialNumber) + "\n";
    out += "\tdigestAlgorithmId: " + digestAlgorithmId + "\n";
    if (authenticatedAttributes != null) {
        out += "\tauthenticatedAttributes: " + authenticatedAttributes +
               "\n";
    }
    out += "\tdigestEncryptionAlgorithmId: " + digestEncryptionAlgorithmId +
        "\n";

    out += "\tencryptedDigest: " + "\n" +
        hexDump.encodeBuffer(encryptedDigest) + "\n";
    if (unauthenticatedAttributes != null) {
        out += "\tunauthenticatedAttributes: " +
               unauthenticatedAttributes + "\n";
    }
    return out;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:SignerInfo.java

示例4: writeBuffer

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
void writeBuffer(OutputStream s, byte [] buf, int off, int len,
        int debugOffset) throws IOException {
    s.write(buf, off, len);
    s.flush();

    // Output only the record from the specified debug offset.
    if (debug != null && Debug.isOn("packet")) {
        try {
            HexDumpEncoder hd = new HexDumpEncoder();

            System.out.println("[Raw write]: length = " +
                                                (len - debugOffset));
            hd.encodeBuffer(new ByteArrayInputStream(buf,
                off + debugOffset, len - debugOffset), System.out);
        } catch (IOException e) { }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:OutputRecord.java

示例5: toString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
/**
 * Return a printable string of IPaddress
 */
public String toString() {
    try {
        return "IPAddress: " + getName();
    } catch (IOException ioe) {
        // dump out hex rep for debugging purposes
        HexDumpEncoder enc = new HexDumpEncoder();
        return "IPAddress: " + enc.encodeBuffer(address);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:IPAddressName.java

示例6: toString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
/**
 * Returns a printable representation of the KeyUsage.
 */
public String toString() {
    String s = "KeyIdentifier [\n";

    HexDumpEncoder encoder = new HexDumpEncoder();
    s += encoder.encodeBuffer(octetString);
    s += "]\n";
    return (s);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:KeyIdentifier.java

示例7: toString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
public String toString()
{
    HexDumpEncoder  encoder = new HexDumpEncoder();

    return "algorithm = " + algid.toString()
        + ", unparsed keybits = \n" + encoder.encodeBuffer(key);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:X509Key.java

示例8: hashInternal

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
private void hashInternal(byte databuf [], int offset, int len) {
    if (debug != null && Debug.isOn("data")) {
        try {
            HexDumpEncoder hd = new HexDumpEncoder();

            System.out.println("[read] MD5 and SHA1 hashes:  len = "
                + len);
            hd.encodeBuffer(new ByteArrayInputStream(databuf, offset, len),
                System.out);
        } catch (IOException e) { }
    }
    handshakeHash.update(databuf, offset, len);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:InputRecord.java

示例9: hashInternal

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
private void hashInternal(byte buf [], int offset, int len) {
    if (debug != null && Debug.isOn("data")) {
        try {
            HexDumpEncoder hd = new HexDumpEncoder();

            System.out.println("[write] MD5 and SHA1 hashes:  len = "
                + len);
            hd.encodeBuffer(new ByteArrayInputStream(buf,
                lastHashed, len), System.out);
        } catch (IOException e) { }
    }

    handshakeHash.update(buf, lastHashed, len);
    lastHashed = count;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:OutputRecord.java

示例10: toString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
public String toString() {
    HexDumpEncoder hd = new HexDumpEncoder();
    return "EncryptionKey: keyType=" + keyType
                      + " keyBytes (hex dump)="
                      + (keyBytes == null || keyBytes.length == 0 ?
                         " Empty Key" :
                         '\n' + hd.encodeBuffer(keyBytes)
                      + '\n');


}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:KeyImpl.java

示例11: engineToString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
protected String engineToString() {
    String LINE_SEP = System.getProperty("line.separator");
    HexDumpEncoder encoder = new HexDumpEncoder();
    StringBuilder sb
        = new StringBuilder(LINE_SEP + "    iv:" + LINE_SEP + "["
            + encoder.encodeBuffer(iv) + "]");

    sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP);
    return sb.toString();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:GCMParameters.java

示例12: toString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
public String toString() {
    String LINE_SEP = System.getProperty("line.separator");

    String ivString = LINE_SEP + "    iv:" + LINE_SEP + "[";
    HexDumpEncoder encoder = new HexDumpEncoder();
    ivString += encoder.encodeBuffer(this.iv);
    ivString += "]" + LINE_SEP;
    return ivString;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:BlockCipherParamsCore.java

示例13: engineToString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
protected String engineToString() {
    String LINE_SEP = System.getProperty("line.separator");
    String saltString = LINE_SEP + "    salt:" + LINE_SEP + "[";
    HexDumpEncoder encoder = new HexDumpEncoder();
    saltString += encoder.encodeBuffer(salt);
    saltString += "]";

    return saltString + LINE_SEP + "    iterationCount:"
        + LINE_SEP + Debug.toHexString(BigInteger.valueOf(iCount))
        + LINE_SEP;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:PBEParameters.java

示例14: engineToString

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
protected String engineToString() {
    String LINE_SEP = System.getProperty("line.separator");
    HexDumpEncoder encoder = new HexDumpEncoder();
    StringBuilder sb
        = new StringBuilder(LINE_SEP + "    iv:" + LINE_SEP + "["
            + encoder.encodeBuffer(iv) + "]");

    if (version != 0) {
        sb.append(LINE_SEP + "version:" + LINE_SEP
            + version + LINE_SEP);
    }
    return sb.toString();
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:14,代码来源:RC2Parameters.java

示例15: printHex

import sun.misc.HexDumpEncoder; //导入方法依赖的package包/类
private static void printHex(HexDumpEncoder dump, byte[] bytes) {
    if (bytes == null) {
        System.out.println("(key bytes not available)");
    } else {
        try {
            dump.encodeBuffer(bytes, System.out);
        } catch (IOException e) {
            // just for debugging, ignore this
        }
    }
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:12,代码来源:Handshaker.java


注:本文中的sun.misc.HexDumpEncoder.encodeBuffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。