Sdílet prostřednictvím


ISeekableByteChannel Interface

Definition

A byte channel that maintains a current position and allows the position to be changed.

[Android.Runtime.Register("java/nio/channels/SeekableByteChannel", "", "Java.Nio.Channels.ISeekableByteChannelInvoker", ApiSince=24)]
public interface ISeekableByteChannel : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.Channels.IByteChannel
[<Android.Runtime.Register("java/nio/channels/SeekableByteChannel", "", "Java.Nio.Channels.ISeekableByteChannelInvoker", ApiSince=24)>]
type ISeekableByteChannel = interface
    interface IByteChannel
    interface IReadableByteChannel
    interface IChannel
    interface ICloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IWritableByteChannel
Derived
Attributes
Implements

Remarks

A byte channel that maintains a current position and allows the position to be changed.

A seekable byte channel is connected to an entity, typically a file, that contains a variable-length sequence of bytes that can be read and written. The current position can be #position() <i>queried</i> and #position(long) <i>modified</i>. The channel also provides access to the current size of the entity to which the channel is connected. The size increases when bytes are written beyond its current size; the size decreases when it is #truncate <i>truncated</i>.

The #position(long) position and #truncate truncate methods which do not otherwise have a value to return are specified to return the channel upon which they are invoked. This allows method invocations to be chained. Implementations of this interface should specialize the return type so that method invocations on the implementation class can be chained.

Added in 1.7.

Java documentation for java.nio.channels.SeekableByteChannel.

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.

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
IsOpen

Returns true if this channel is open.

(Inherited from IChannel)
JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)

Methods

Close()

Closes this channel.

(Inherited from IChannel)
Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
Position()

Returns this channel's position.

Position(Int64)

Sets this channel's position.

Read(ByteBuffer)

Reads a sequence of bytes from this channel into the given buffer.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
Size()

Returns the current size of entity to which this channel is connected.

Truncate(Int64)

Truncates the entity, to which this channel is connected, to the given size.

UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)
Write(ByteBuffer)

Writes a sequence of bytes to this channel from the given buffer.

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)
ReadAsync(IReadableByteChannel, ByteBuffer)
WriteAsync(IWritableByteChannel, ByteBuffer)

Applies to