Sets a 16-bit integer in the given byte array at the given offset.
961189
public static void setInt16(byte[] dst, int offset, int value) {
        assert (value & 0xffff) == value : "value out of range";
        
        dst[offset + 0] = (byte) (value & 0xFF);
        dst[offset + 1] = (byte) ((value >>> 8) & 0xFF);
    }
1282391
def setbit(self, key, offset, value):
        
        if not isinstance(offset, int):
            raise TypeError("offset argument must be int")
        if offset < 0:
            raise ValueError("offset must be greater equal 0")
        if value not in (0, 1):
            raise ValueError("value argument must be either 1 or 0")
        return self.execute(b'SETBIT', key, offset, value)
48382
public void set(byte[] buff, int offset, int length){
        if(offset<0)
            throw new IndexOutOfBoundsException("ByteSequence index out of range: "+offset);
        if(length<0)
            throw new IndexOutOfBoundsException("ByteSequence index out of range: "+length);
        if(offset>buff.length-length)
            throw new StringIndexOutOfBoundsException("ByteSequence index out of range: "+(offset+length));

        this.buff = buff;
        this.offset = offset;
        this.length = length;
    }
555450
public static void putLongBE(final byte[] array, final int offset, final long value) {
    array[offset + 7] = (byte) (value       );
    array[offset + 6] = (byte) (value >>>  8);
    array[offset + 5] = (byte) (value >>> 16);
    array[offset + 4] = (byte) (value >>> 24);
    array[offset + 3] = (byte) (value >>> 32);
    array[offset + 2] = (byte) (value >>> 40);
    array[offset + 1] = (byte) (value >>> 48);
    array[offset    ] = (byte) (value >>> 56);
  }
390973
public static int putDouble(byte [] bytes, int offset, double d) {
    return putLong(bytes, offset, Double.doubleToLongBits(d));
  }
439500
public static void set(long[] bits, int pos) {
    int offset = pos >> LONG_SHIFT;
    if (offset >= bits.length)
      throw new IndexOutOfBoundsException();
    bits[offset] |= 1L << pos;
  }
105034
public static int parseBE4BytesAsInt(byte[] data, int offset)
    {
        int value = ((data[offset + 0] & 0xFF) << 24)
                  | ((data[offset + 1] & 0xFF) << 16)
                  | ((data[offset + 2] & 0xFF) <<  8)
                  | ((data[offset + 3] & 0xFF));

        return value;
    }
756100
public static void writeInt32(final int value, final byte[] buffer, int offset)
    {
        buffer[offset++] = (byte) ((value >>> 24) & 0xFF);
        buffer[offset++] = (byte) ((value >>> 16) & 0xFF);
        buffer[offset++] = (byte) ((value >>> 8) & 0xFF);
        buffer[offset] = (byte) ((value >>> 0) & 0xFF);
    }
250884
public static void setInt(final byte[] b, final int n, final int offset) {
        b[offset + 0] = (byte) (n >>> 24);
        b[offset + 1] = (byte) (n >>> 16);
        b[offset + 2] = (byte) (n >>> 8);
        b[offset + 3] = (byte) (n >>> 0);
    }
1144448
protected void setByteArrayValue(byte[] input, int offset, int length) {
        if ((offset + length) > input.length) {
            throw new IllegalArgumentException(
                            "Invalid length: " + offset + "+" + length + " > " + input.length);
        }
        this.sValue = null;
        this.bValue = input;
        this.offset = offset;
        this.valueLength = length;
        if (ELEM_ADDED != this.status) {
            this.status = ELEM_CHANGED;
        }
    }
807915
public static void writeUnsignedIntegerLittleEndian(byte[] buffer, int offset, long value) {
		buffer[offset++] = (byte)(value & 0xFF);
		buffer[offset++] = (byte)((value >> 8) & 0xFF);
		buffer[offset++] = (byte)((value >> 16) & 0xFF);
		buffer[offset] = (byte)((value >> 24) & 0xFF);
	}
916698
private int uint16FromData(int offset) {
        return twoBytesToInt(
                Arrays.copyOfRange(data(), offset, offset + 2),
                Constants.CC2540_BYTE_ORDER
        );
    }
839037
public static void putDoubleBE(final byte[] array, final int offset, final double value) {
    putLongBE(array, offset, Double.doubleToRawLongBits(value));
  }
788781
private static int extractInt(byte[] arr, int offset) {
        return ((arr[offset] & 0xFF) << 24) | ((arr[offset + 1] & 0xFF) << 16) | ((arr[offset + 2] & 0xFF) << 8)
                | (arr[offset + 3] & 0xFF);
    }
764189
static int getInt(byte[] buffer, int offset) {
        return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16 | (buffer[offset + 2] & 0xff) << 8
                | (buffer[offset + 3] & 0xff);
    }
193864
function uint16BEtoNumber(bytes) {
  var n = 0;
  for (var i = 0; i < 1; i++) {
    n |= bytes[i];
    n <<= 8;
  }
  n |= bytes[1];
  return n;
}
508863
public static int bytesToInt(byte[] bytes, int offset) {
        // 
        int result = 0x00000000;

        int length;
        if (bytes.length - offset < 4) // maximum byte size for int data type
                                        // is 4
            length = bytes.length - offset;
        else
            length = 4;

        int end = offset + length;
        for (int i = 0; i < length; i++) {
            result |= (bytes[end - i - 1] & 0xff) << (8 * i); // TODO uudashr: CHECK FOR IMPROVEMENT
        }
        return result;
    }