Check the ByteArray actual size before writing it to ByteBuffer.

ByteArray is the unique type whose actual size might be different
with the size delcared in the annotation, e.g, user initializes an
object manually, or mutates the byte array after parsing from
ByteBuffer. Therefore, checking the length of byte array is required
before writing the array value to output bytes array or ByteBuffer.

Bug: 163492391
Test: atest NetworkStaticLibTests
Change-Id: I28936a2afbe60dd2dadac803d08062df153b2588
2 files changed
tree: 968a3233a850bac77785fa3084afab4b1c2d0da1
  1. staticlibs/