共用方式為


Buffer.Rewind Method

Definition

Rewinds this buffer.

[Android.Runtime.Register("rewind", "()Ljava/nio/Buffer;", "GetRewindHandler")]
public virtual Java.Nio.Buffer? Rewind ();
[<Android.Runtime.Register("rewind", "()Ljava/nio/Buffer;", "GetRewindHandler")>]
abstract member Rewind : unit -> Java.Nio.Buffer
override this.Rewind : unit -> Java.Nio.Buffer

Returns

This buffer

Attributes

Remarks

Rewinds this buffer. The position is set to zero and the mark is discarded.

Invoke this method before a sequence of channel-write or get operations, assuming that the limit has already been set appropriately. For example:

<blockquote>

out.write(buf);    // Write remaining data
            buf.rewind();      // Rewind buffer
            buf.get(array);    // Copy data into array

</blockquote>

Java documentation for java.nio.Buffer.rewind().

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