Examples of bufferList()


Examples of net.tomp2p.storage.DataBuffer.bufferList()

    public static Number160 makeSHAHash(DataBuffer buffer) {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-1");
            DataBuffer copy = buffer.shallowCopy();
            for (ByteBuffer byteBuffer : copy.bufferList()) {
                md.update(byteBuffer);
            }
            byte[] digest = md.digest();
            return new Number160(digest);
        } catch (NoSuchAlgorithmException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.