yes,
The method does not change the position of the FileChannel Reader.
Add it in the javadoc is a good idea.
---
Xiangdong Huang
School of Software, Tsinghua University
黄向东
清华大学 软件学院
Yuan Tian 于2019年9月9日周一 下午9:33写道:
> Hi,
>
> While implementing one read
Hi,
- `TsFileInput.read(ByteBuffer dst, long position)` does not modify this
TsFileInput's position.
It works just as the annotation depicts.
If you do a simple experiment using the `class DefaultTsFileInput implements
TsFileInput` to
1) position(), 2) read(ByteBuffer dst, long position),
Hi, Boris
Yes, like what I said, the method without position signature acts like the
inputStream that you can’t manually change the position where you want to read.
Instead, you can only read by order. The position will automatically move
forward while you read data from the stream.
Best,
I check-in java doc and it says the file position is updated with the
number of bytes actually read. You can see below
* Reads a sequence of bytes from this channel into the given buffer.
*
* Bytes are read starting at this channel's current file position, and
* then the file position is
Hi, Boris
If the position is not specified, I think the position should be modified.
There are two methods in TsFileInput interface that don’t have position
parameter in their function signature.
1.
int read(ByteBuffer dst) throws IOException;
2.
int read() throws IOException;
Actually, in
I agree with you that shouldn’t modify the position of TsFileInput when
having already specified the position. Sorry for the misunderstanding. But
if not specified, should it be changed for hdfs or local?
Best,
Boris zhu
On Mon, Sep 9, 2019 at 11:35 PM Yuan Tian wrote:
> In fact, I am working
In fact, I am working on the hadoop-connector, so I should create a HDFSInput
that implements TsFileInput interface for reading tsfile from HDFS.
And actually, in DefaultTsFileInput, this method is unsupported which you can
see in the following.
@Override
public int read(byte[] b, int off, int
Hi, tian
DefaultTsFileInput is a class to implement TsFileInput
interface. DefaultTsFileInput's method read actually change the position of
itself because it uses java.io.FileChannel, and we can use a "position"
method to change its position back. But I'm also confusing that why can't
change the