Megosztás a következőn keresztül:


ByteBuffer.Mismatch(ByteBuffer) Method

Definition

Finds and returns the relative index of the first mismatch between this buffer and a given buffer.

[Android.Runtime.Register("mismatch", "(Ljava/nio/ByteBuffer;)I", "GetMismatch_Ljava_nio_ByteBuffer_Handler", ApiSince=34)]
public virtual int Mismatch (Java.Nio.ByteBuffer that);
[<Android.Runtime.Register("mismatch", "(Ljava/nio/ByteBuffer;)I", "GetMismatch_Ljava_nio_ByteBuffer_Handler", ApiSince=34)>]
abstract member Mismatch : Java.Nio.ByteBuffer -> int
override this.Mismatch : Java.Nio.ByteBuffer -> int

Parameters

that
ByteBuffer

The byte buffer to be tested for a mismatch with this buffer

Returns

The relative index of the first mismatch between this and the given buffer, otherwise -1 if no mismatch.

Attributes

Remarks

Finds and returns the relative index of the first mismatch between this buffer and a given buffer. The index is relative to the #position() position of each buffer and will be in the range of 0 (inclusive) up to the smaller of the #remaining() remaining elements in each buffer (exclusive).

If the two buffers share a common prefix then the returned index is the length of the common prefix and it follows that there is a mismatch between the two buffers at that index within the respective buffers. If one buffer is a proper prefix of the other then the returned index is the smaller of the remaining elements in each buffer, and it follows that the index is only valid for the buffer with the larger number of remaining elements. Otherwise, there is no mismatch.

Added in 11.

Java documentation for java.nio.ByteBuffer.mismatch(java.nio.ByteBuffer).

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