org.apache.hadoop.fs-Seekable

來源:互聯網
上載者:User

標籤:style   blog   color   io   os   ar   java   檔案   sp   

本來要先看BufferedFSInputStream的,但是它實現了Seekable和PositionedReadable介面,就先看這兩個,再看它會比較容易理解些

 1 package org.apache.hadoop.fs; 2  3 import java.io.*; 4  5 /** Stream that permits seeking. */ 6 //提供按位置尋找功能的介面 7 public interface Seekable { 8   /** 9    * Seek to the given offset from the start of the file.10    * The next read() will be from that location.  Can‘t11    * seek past the end of the file.12    */13   void seek(long pos) throws IOException;14   //從指定檔案中的位置pos,對檔案流進行前向搜尋。15   /**16    * Return the current offset from the start of the file17    */18   long getPos() throws IOException;19 //返迴文件流中當前位移位置。 20   /**21    * Seeks a different copy of the data.  Returns true if 22    * found a new source, false otherwise.23    */24   boolean seekToNewSource(long targetPos) throws IOException;25   //從targetPos位置搜尋檔案資料的一個不同拷貝,搜尋到則返回true,否則返回false。26 }

 

 

org.apache.hadoop.fs-Seekable

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.