mirror of
https://github.com/samsonjs/media.git
synced 2026-06-28 05:29:33 +00:00
Use ByteBuffer.remaining() instead of ByteBuffer.limit() in BoxUtil
PiperOrigin-RevId: 610414628
This commit is contained in:
parent
e98858424a
commit
63a8fff69e
1 changed files with 2 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ import java.util.List;
|
|||
public static ByteBuffer wrapBoxesIntoBox(String boxType, List<ByteBuffer> boxes) {
|
||||
int totalSize = BOX_TYPE_BYTES + BOX_SIZE_BYTES;
|
||||
for (int i = 0; i < boxes.size(); i++) {
|
||||
totalSize += boxes.get(i).limit();
|
||||
totalSize += boxes.get(i).remaining();
|
||||
}
|
||||
|
||||
ByteBuffer result = ByteBuffer.allocate(totalSize);
|
||||
|
|
@ -72,7 +72,7 @@ import java.util.List;
|
|||
public static ByteBuffer concatenateBuffers(ByteBuffer... buffers) {
|
||||
int totalSize = 0;
|
||||
for (ByteBuffer buffer : buffers) {
|
||||
totalSize += buffer.limit();
|
||||
totalSize += buffer.remaining();
|
||||
}
|
||||
|
||||
ByteBuffer result = ByteBuffer.allocate(totalSize);
|
||||
|
|
|
|||
Loading…
Reference in a new issue