createFromChannel
java.nio.channels.SeekableByteChannel createFromChannel(java.nio.channels.SeekableByteChannel channel,
long lower,
long upper)
Create a restricted byte channel from the given existing channel. The returned byte channel is
limited to accessing data in the range [lower, upper) expressed as offsets in the base
channel. If the base channel was readable, the new channel will be readable. If the base
channel was writable, the new channel will be writable. The new channel is configured such that
a read/write from/to positions [0, upper - lower] in the new channel will equate to a
read/write to/from positions [lower, upper] in the base channel. Closing the new
channel will not close the base channel.
- Parameters:
channel - The base channel
lower - The absolute, inclusive lower bound of the new channel
upper - The absolute, exclusive upper bound of the new channel
- Returns:
- A new byte channel