Interface GeneralByteChannel

All Superinterfaces:
AutoCloseable, ByteChannel, Channel, Closeable, ReadableByteChannel, SeekableByteChannel, WritableByteChannel

public interface GeneralByteChannel extends ReadableByteChannel, SeekableByteChannel, WritableByteChannel
Encapsulates ReadableByteChannel, SeekableByteChannel, WritableByteChannel to have a single type to return from Streams.channel() which is compatible with APIs that take the types implemented by FileChannel.
Author:
Tim Boudreau
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the same value as position(), but as an int, since Java arrays do not support > Integer.MAX_VALUE arrays, so it will always fit.
    position(long newPosition)
     
    int
    Reset the channel's position and closed state (if possible); useful for avoiding copies in the case of a channel that is used for writes and then reads.
    truncate(long size)
     

    Methods inherited from interface java.nio.channels.Channel

    close, isOpen

    Methods inherited from interface java.nio.channels.SeekableByteChannel

    position, read, size, write
  • Method Details