Originally want to see Bufferedfsinputstream first, but it realizes the seekable and Positionedreadable interface, first look at these two, then see it will be more easy to understand some
1 PackageOrg.apache.hadoop.fs;2 3 ImportJava.io.*;4 5 /**Stream that permits seeking.*/6 //provides an interface for locating by location function7 Public Interfaceseekable {8 /**9 * Seek to the given offset from the start of the file.Ten * The next read () would be is from this location. Can ' t One * Seek past the end of the file. A */ - voidSeekLongPosthrowsIOException; - //forward search for a file stream from the location POS in the specified file. the /** - * Return The current offset from the start of the file - */ - LongGetPos ()throwsIOException; + //returns the current offset position in the file stream. - /** + * seeks a different copy of the data. Returns true if A * found a new source, false otherwise. at */ - BooleanSeektonewsource (LongTargetpos)throwsIOException; - //searches for a different copy of the file data from the Targetpos location, returns true if it is searched, or false otherwise. -}
Org.apache.hadoop.fs-seekable