suppress warning
Change-Id: Ic1fbe907c9e533eb4ed320efc13a313042edd132
Showing
2 changed files
with
5 additions
and
7 deletions
| ... | @@ -20,8 +20,7 @@ public class IpAddressSerializer extends Serializer<IpAddress> { | ... | @@ -20,8 +20,7 @@ public class IpAddressSerializer extends Serializer<IpAddress> { |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | - public void write(Kryo kryo, Output output, | 23 | + public void write(Kryo kryo, Output output, IpAddress object) { |
| 24 | - IpAddress object) { | ||
| 25 | byte[] octs = object.toOctets(); | 24 | byte[] octs = object.toOctets(); |
| 26 | output.writeInt(octs.length); | 25 | output.writeInt(octs.length); |
| 27 | output.writeBytes(octs); | 26 | output.writeBytes(octs); |
| ... | @@ -29,11 +28,10 @@ public class IpAddressSerializer extends Serializer<IpAddress> { | ... | @@ -29,11 +28,10 @@ public class IpAddressSerializer extends Serializer<IpAddress> { |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | @Override | 30 | @Override |
| 32 | - public IpAddress read(Kryo kryo, Input input, | 31 | + public IpAddress read(Kryo kryo, Input input, Class<IpAddress> type) { |
| 33 | - Class<IpAddress> type) { | 32 | + final int octLen = input.readInt(); |
| 34 | - int octLen = input.readInt(); | ||
| 35 | byte[] octs = new byte[octLen]; | 33 | byte[] octs = new byte[octLen]; |
| 36 | - input.read(octs); | 34 | + input.readBytes(octs); |
| 37 | int prefLen = input.readInt(); | 35 | int prefLen = input.readInt(); |
| 38 | return IpAddress.valueOf(octs, prefLen); | 36 | return IpAddress.valueOf(octs, prefLen); |
| 39 | } | 37 | } | ... | ... |
| ... | @@ -34,7 +34,7 @@ public final class IpPrefixSerializer extends Serializer<IpPrefix> { | ... | @@ -34,7 +34,7 @@ public final class IpPrefixSerializer extends Serializer<IpPrefix> { |
| 34 | Class<IpPrefix> type) { | 34 | Class<IpPrefix> type) { |
| 35 | int octLen = input.readInt(); | 35 | int octLen = input.readInt(); |
| 36 | byte[] octs = new byte[octLen]; | 36 | byte[] octs = new byte[octLen]; |
| 37 | - input.read(octs); | 37 | + input.readBytes(octs); |
| 38 | int prefLen = input.readInt(); | 38 | int prefLen = input.readInt(); |
| 39 | return IpPrefix.valueOf(octs, prefLen); | 39 | return IpPrefix.valueOf(octs, prefLen); |
| 40 | } | 40 | } | ... | ... |
-
Please register or login to post a comment