Here you can find the source of getHashBytes(ByteBuffer bb)
Parameter | Description |
---|---|
bb | ByteBuffer containing the hash code |
public static byte[] getHashBytes(ByteBuffer bb)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { /**/*from w w w . j a va2 s. co m*/ * Returns a byte[] from the info_hash ByteBuffer for simplicity. * @param bb ByteBuffer containing the hash code * @return byte[] info_hash 20 bytes */ public static byte[] getHashBytes(ByteBuffer bb) { bb.position(0); byte[] array = new byte[20]; bb.get(array); return array; } }