BufferedData readBytes() and writeBytes() are not symmetric
Open
- Dominant language
- Java
- Stars
- 44
- Forks
- 15
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 12
Description
`BufferedData` class contains `readBytes()` and `writeBytes()` method, which work with another `BufferedData` object. I would expect that
```java
bufferedData1.readBytes(bufferedData2);
```
should be the same as
```java
bufferedData2.writeBytes(bufferedData1);
```
but they are not. `writeBytes()` just forwards the call to the underlying byte buffer. `readBytes()` is slightly more intelligent, it checks remaining bytes, sets the limit, then write actual bytes, and finally resets the limit.
Contributor guide
Assessment
This issue has not been assessed yet.