You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The offset tells where the implementation of the DataReader should start writing data into the buffer array that is passed into the method.
A user of the DataReader passes the buffer array that they own and then decide where the data reader should start writing data into the buffer array.
If you implement a DataReader then you only have to set the offset when you are doing a unit test that calls this method. If the DataSource is used as part of the player, this method is called by some component of the player. You don't have to call this yourself as far as I understand.
I'm afraid but I'm not sure I understand. Like I said, this is probably called by the player that is using your implementation in case you have configured the player accordingly.
Assuming the testee dataReader is created in setUp of your unit test may call:
@Test
public void read() {
byte[] buffer = new byte[20];
int offset = 5;
Arrays.fill(buffer, (byte) 1);
dataReader.read(buffer, offset, 10);
// assert here only bytes 5 - 15 are overridden by the reader.
}
How to set the offset byte stream
I tried to implement it with request headers but it couldn't
The text was updated successfully, but these errors were encountered: