org.apache.hadoop.fs-PositionedReadable


 

 

 1 package org.apache.hadoop.fs;
 2 
 3 import java.io.*;
 4 import org.apache.hadoop.fs.*;
 5 
 6 /** Stream that permits positional reading. */
 7 //定位流式读取
 8 public interface PositionedReadable {
 9   /**
10    * Read upto the specified number of bytes, from a given
11    * position within a file, and return the number of bytes read. This does not
12    * change the current offset of a file, and is thread-safe.
13    */
14   public int read(long position, byte[] buffer, int offset, int length)
15     throws IOException;
16   //读取文件流中最多到length大小的字节,到字节缓冲区buffer中,它是从给定的position位置开始读取的。  
17   //该读取方式不改变文件的当前偏移位置offset,并且该方法是线程安全的
18   /**
19    * Read the specified number of bytes, from a given
20    * position within a file. This does not
21    * change the current offset of a file, and is thread-safe.
22    */
23   public void readFully(long position, byte[] buffer, int offset, int length)
24     throws IOException;
25   /** 
26    * 读取文件流中length大小的字节,到字节缓冲区buffer中,它是从给定的position位置开始读取的。 
27    * 该读取方式不改变文件的当前偏移位置offset,并且该方法是线程安全的。 
28    */ 
29   /**
30    * Read number of bytes equalt to the length of the buffer, from a given
31    * position within a file. This does not
32    * change the current offset of a file, and is thread-safe.
33    */
34   public void readFully(long position, byte[] buffer) throws IOException;
35   /** 
36    * 读取文件流中buffer长度的字节,到字节缓冲区buffer中,它是从给定的position位置开始读取的 
37    * 该读取方式不改变文件的当前偏移位置offset,并且该方法是线程安全的。 
38    */  
39 
40 }

 


 

转载于:https://www.cnblogs.com/admln/p/PositionedReadable.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值