Share via


Integer.Compress(Int32, Int32) Method

Definition

Returns the value obtained by compressing the bits of the specified int value, i, in accordance with the specified bit mask.

[Android.Runtime.Register("compress", "(II)I", "", ApiSince=36)]
public static int Compress(int i, int mask);
[<Android.Runtime.Register("compress", "(II)I", "", ApiSince=36)>]
static member Compress : int * int -> int

Parameters

i
Int32

the value whose bits are to be compressed

mask
Int32

the bit mask

Returns

the compressed value

Attributes

Remarks

Returns the value obtained by compressing the bits of the specified int value, i, in accordance with the specified bit mask.

For each one-bit value mb of the mask, from least significant to most significant, the bit value of i at the same bit location as mb is assigned to the compressed value contiguously starting from the least significant bit location. All the upper remaining bits of the compressed value are set to zero.

Added in 19.

Java documentation for java.lang.Integer.compress(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to