次の方法で共有


ISeekableByteChannel.Position Method

Definition

Overloads

Position()

Returns this channel's position.

Position(Int64)

Sets this channel's position.

Position()

Returns this channel's position.

[Android.Runtime.Register("position", "()J", "GetPositionHandler:Java.Nio.Channels.ISeekableByteChannelInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public long Position ();
[<Android.Runtime.Register("position", "()J", "GetPositionHandler:Java.Nio.Channels.ISeekableByteChannelInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member Position : unit -> int64

Returns

This channel's position, a non-negative integer counting the number of bytes from the beginning of the entity to the current position

Attributes

Remarks

Returns this channel's position.

Java documentation for java.nio.channels.SeekableByteChannel.position().

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

Position(Int64)

Sets this channel's position.

[Android.Runtime.Register("position", "(J)Ljava/nio/channels/SeekableByteChannel;", "GetPosition_JHandler:Java.Nio.Channels.ISeekableByteChannelInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public Java.Nio.Channels.ISeekableByteChannel? Position (long newPosition);
[<Android.Runtime.Register("position", "(J)Ljava/nio/channels/SeekableByteChannel;", "GetPosition_JHandler:Java.Nio.Channels.ISeekableByteChannelInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member Position : int64 -> Java.Nio.Channels.ISeekableByteChannel

Parameters

newPosition
Int64

The new position, a non-negative integer counting the number of bytes from the beginning of the entity

Returns

This channel

Attributes

Remarks

Sets this channel's position.

Setting the position to a value that is greater than the current size is legal but does not change the size of the entity. A later attempt to read bytes at such a position will immediately return an end-of-file indication. A later attempt to write bytes at such a position will cause the entity to grow to accommodate the new bytes; the values of any bytes between the previous end-of-file and the newly-written bytes are unspecified.

Setting the channel's position is not recommended when connected to an entity, typically a file, that is opened with the java.nio.file.StandardOpenOption#APPEND APPEND option. When opened for append, the position is first advanced to the end before writing.

Java documentation for java.nio.channels.SeekableByteChannel.position(long).

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