X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Ffactories%2FMultipartReplyMessageFactory.java;fp=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Ffactories%2FMultipartReplyMessageFactory.java;h=628d388d5bd588359296d6f02e2538a8ec3d1e30;hb=b463f7cdcac1941603dcc16057f948966bfa4091;hp=15e9f77cb8e4c3c0f78605115e083049502b8181;hpb=6886d905cc9ba4f39965b87714c2a62446866091;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java index 15e9f77c..628d388d 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java @@ -281,15 +281,15 @@ public class MultipartReplyMessageFactory implements OFDeserializer bucketStatsList = new ArrayList<>(); while (actualLength < bodyLength) { BucketStatsBuilder bucketStatsBuilder = new BucketStatsBuilder(); - byte[] packetCountBucket = new byte[Long.SIZE/Byte.SIZE]; + byte[] packetCountBucket = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; input.readBytes(packetCountBucket); - bucketStatsBuilder.setPacketCount(new BigInteger(packetCountBucket)); - byte[] byteCountBucket = new byte[Long.SIZE/Byte.SIZE]; + bucketStatsBuilder.setPacketCount(new BigInteger(1, packetCountBucket)); + byte[] byteCountBucket = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; input.readBytes(byteCountBucket); - bucketStatsBuilder.setByteCount(new BigInteger(byteCountBucket)); + bucketStatsBuilder.setByteCount(new BigInteger(1, byteCountBucket)); bucketStatsList.add(bucketStatsBuilder.build()); actualLength += BUCKET_COUNTER_LENGTH; } @@ -592,24 +592,24 @@ public class MultipartReplyMessageFactory implements OFDeserializer meterBandStatsList = new ArrayList<>(); while (actualLength < meterStatsBodyLength) { MeterBandStatsBuilder meterBandStatsBuilder = new MeterBandStatsBuilder(); - byte[] packetBandCount = new byte[Long.SIZE/Byte.SIZE]; + byte[] packetBandCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; input.readBytes(packetBandCount); - meterBandStatsBuilder.setPacketBandCount(new BigInteger(packetBandCount)); - byte[] byteBandCount = new byte[Long.SIZE/Byte.SIZE]; + meterBandStatsBuilder.setPacketBandCount(new BigInteger(1, packetBandCount)); + byte[] byteBandCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; input.readBytes(byteBandCount); - meterBandStatsBuilder.setByteBandCount(new BigInteger(byteBandCount)); + meterBandStatsBuilder.setByteBandCount(new BigInteger(1, byteBandCount)); meterBandStatsList.add(meterBandStatsBuilder.build()); actualLength += METER_BAND_STATS_LENGTH; }