Creating a single-byte array is not needed here.
Change-Id: I518419438d6eae6146616fba0725245fc348fee7
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
51ea1ad17e3fd9b7ffe943cfe5f4e3bd71a892c8)
final List<Ipv4Prefix> list = new ArrayList<>();
int byteOffset = 0;
while (byteOffset < bytes.length) {
- final int bitLength = UnsignedBytes.toInt(ByteArray.subByte(bytes, byteOffset, 1)[0]);
+ final int bitLength = UnsignedBytes.toInt(bytes[byteOffset]);
byteOffset += 1;
// if length == 0, default route will be added
if (bitLength == 0) {
final List<Ipv6Prefix> list = new ArrayList<>();
int byteOffset = 0;
while (byteOffset < bytes.length) {
- final int bitLength = UnsignedBytes.toInt(ByteArray.subByte(bytes, byteOffset, 1)[0]);
+ final int bitLength = UnsignedBytes.toInt(bytes[byteOffset]);
byteOffset += 1;
// if length == 0, default route will be added
if (bitLength == 0) {