Code example for ByteBuffer

Methods: putInt

0
     * 
     * @param bb ByteBuffer to put the int into 
     * @param v the long containing the unsigned int 
     */ 
    public static void putUnsignedInt(ByteBuffer bb, long v) {
        bb.putInt((int) (v & 0xffffffffL));
    } 
 
    /** 
     * Put an unsigned int into the specified ByteBuffer at the specified offset 
     * 
     * @param bb ByteBuffer to put the int into 
     * @param v the long containing the unsigned int 
     * @param offset the offset to insert the unsigned int at 
     */ 
    public static void putUnsignedInt(ByteBuffer bb, long v, int offset) {
        bb.putInt(offset, (int) (v & 0xffffffffL));
    } 
 
    /** 
     * Get an unsigned long from the current position of the ByteBuffer