Code example for ByteBuffer

Methods: putShort

0
     * 
     * @param bb ByteBuffer to put the short into 
     * @param v the int containing the unsigned short 
     */ 
    public static void putUnsignedShort(ByteBuffer bb, int v) {
        bb.putShort((short) (v & 0xffff));
    } 
 
    /** 
     * Put an unsigned short into the specified ByteBuffer at the specified 
     * offset 
     * 
     * @param bb ByteBuffer to put the short into 
     * @param v the int containing the unsigned short 
     * @param offset the offset to insert the unsigned short at 
     */ 
    public static void putUnsignedShort(ByteBuffer bb, int v, int offset) {
        bb.putShort(offset, (short) (v & 0xffff));
    } 
 
    /**