Open tukez opened 3 months ago
Indeed. Just moving the position to the limit would do it.
StreamPack does not use the ByteBuffer
once they have been read by toByteArray()
Could you have a look at https://github.com/ThibaultBee/StreamPack/pull/162?
Looks correct.
Version
2.6.1
Environment that reproduces the issue
No devices.
RTMP/SRT/... Server
No server.
Audio configuration
No response
Video configuration
No response
Is it reproducible in the demos application?
Yes
Reproduction steps
byteBuffer.toByteArray()
Expected result
ByteBuffer.toByteArray() has two implementations, one for array backed buffers and one for others. The array backed implementation does not move the ByteBuffer position whereas the other implementation does.
Noticed this while reading the source code, a possible source of bugs.
Actual result
Implementation works the same for all ByteBuffers.
Additional context
No response
Relevant logs output
No response