uk.ac.starlink.treeview
Interface HexDumper.ByteSource

Enclosing class:
HexDumper

public static interface HexDumper.ByteSource

Defines the data model used to construct a HexDumper.


Method Summary
 boolean isRandom()
          Indicates whether random access is available.
 int length()
          Returns the number of bytes in this object, or -1 if the number is not known.
 int read(int pos)
          Returns the byte at the given position, or -1 if pos is beyond the end of the file.
 

Method Detail

read

int read(int pos)
         throws IOException
Returns the byte at the given position, or -1 if pos is beyond the end of the file. Will only be invoked on pos values in strictly monotonically increasing order unless isRandom returns false.

Parameters:
pos - the position of the byte to read
Returns:
the byte value at pos, or -1
Throws:
IOException - if somethiing goes wrong

length

int length()
Returns the number of bytes in this object, or -1 if the number is not known.

Returns:
the length of the source, or -1 if not known

isRandom

boolean isRandom()
Indicates whether random access is available.

Returns:
true iff read may be invoked in non-monotonic increasing order


Copyright © 2002-2017 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.