Java ByteBuffer Get getHashBytes(ByteBuffer bb)

Here you can find the source of getHashBytes(ByteBuffer bb)

Description

Returns a byte[] from the info_hash ByteBuffer for simplicity.

License

Open Source License

Parameter

Parameter Description
bb ByteBuffer containing the hash code

Return

byte[] info_hash 20 bytes

Declaration

public static byte[] getHashBytes(ByteBuffer bb) 

Method Source Code

//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;
    }
}

Related

  1. getFixedBytes(ByteBuffer buffer, int length)
  2. getFloat(ByteBuffer b, int n)
  3. getFloat(ByteBuffer buffer)
  4. getFloat(ByteBuffer floatCalculator, byte[] bytes)
  5. getFromBack(ByteBuffer bb)
  6. getHSBfromRGB(final ByteBuffer pixels, final float[] result, int pixelSize)
  7. getIncreasingByteBuffer(int len)
  8. getIPv4String(ByteBuffer buffer)
  9. getJagexString(ByteBuffer buf)