Provides convenience methods for working with a ( {@link ReadableByteChannel}, {@link ByteBuffer}) pair. The channel and the buffer must be supplied by the caller. It is okay if they have already been used before {@code ChannelDataInput} creation.{@section Encapsulation}This class exposes publicly the {@linkplain #channel} and the {@linkplain #buffer} because it is not expectedto perform all possible data manipulations that we can do with the buffers. This class is only a helper tool, which often needs to be completed by specialized operations performed directly on the buffer. However, users are encouraged to transfer data from the channel to the buffer using only the methods provided in this class if they want to keep the {@link #seek(long)} and {@link #getStreamPosition()} values accurate.
Since this class is only a helper tool, it does not "own" the channel and consequently does not provide {@code close()} method. It is users responsibility to close the channel after usage.
{@section Relationship with
DataInput
}This class API is compatibly with the {@link java.io.DataInput} interface, so subclasses can implement thatinterface if they wish. This class does not implement {@code DataInput} itself because it is not needed forSIS purposes, and because {@code DataInput} has undesirable methods ({@code readLine()} and {@code readUTF()}). However the {@link ChannelImageInputStream} class implements the {@code DataInput} interface, together withthe {@link javax.imageio.stream.ImageInputStream} one, mostly for situations when inter-operability with{@link javax.imageio} is needed.
@author Martin Desruisseaux (Geomatys)
@since 0.3 (derived from geotk-3.07)
@version 0.3
@module