Pipe.SourceChannel

  • Pipe.SourceChannel represents the readable end of a Pipe and implements ReadableByteChannel and ScatteringByteChannel.

  • It supports a single operation, SelectionKey.OP_READ, for reading data.

  • This class provides methods for reading a sequence of bytes into a ByteBuffer or an array of ByteBuffers.

  • Pipe.SourceChannel inherits functionalities from AbstractSelectableChannel for channel management and I/O operations.

  • A protected constructor is available, taking a SelectorProvider as an argument to create a new instance.

public static abstract class Pipe.SourceChannel extends AbstractSelectableChannel
implements ReadableByteChannel ScatteringByteChannel

A channel representing the readable end of a Pipe.

Protected Constructor Summary

SourceChannel(SelectorProvider provider)
Constructs a new instance of this class.

Public Method Summary

final int
validOps()
Returns an operation set identifying this channel's supported operations.

Inherited Method Summary

Protected Constructors

protected SourceChannel (SelectorProvider provider)

Constructs a new instance of this class.

Parameters
provider The selector provider

Public Methods

public final int validOps ()

Returns an operation set identifying this channel's supported operations.

Pipe-source channels only support reading, so this method returns SelectionKey.OP_READ.

Returns
  • The valid-operation set