uk.me.parabola.imgfmt.fs
Interface ImgChannel

All Superinterfaces:
java.nio.channels.ByteChannel, java.nio.channels.Channel, java.io.Closeable, java.nio.channels.ReadableByteChannel, java.nio.channels.WritableByteChannel
All Known Implementing Classes:
FileImgChannel, FileNode

public interface ImgChannel
extends java.nio.channels.ByteChannel

An extension of ByteChannel that allows us to know the position. It may evolve to have several of the methods of the FileChannel class and plays a similar role.

Author:
Steve Ratcliffe

Method Summary
 long position()
          Get the file position.
 void position(long pos)
          Set the position within the file.
 
Methods inherited from interface java.nio.channels.ReadableByteChannel
read
 
Methods inherited from interface java.nio.channels.WritableByteChannel
write
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 

Method Detail

position

long position()
Get the file position. Note that this is a logical position relative to the beginning of the file (the file within the .img file, not the beginning of the .img file itself).

Returns:
The offset in bytes from the beginning of the file.

position

void position(long pos)
Set the position within the file.

Parameters:
pos - The position to set.