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 {@link #position() queried} and{@link #position(long) modified}. 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 {@link #truncate truncated}.
The {@link #position(long) position} and {@link #truncate truncate} methodswhich 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. @since 1.7 @see java.nio.file.Files#newByteChannel
|
|
|
|