Support for bitwise AND/OR/XOR in ImmutableByteSequence

Also, minor refactoring of the fit() method to improve code readability

Change-Id: I826650c3fc45573c723d9d2dd8692da174d9ae08
diff --git a/pipelines/basic/src/main/java/org/onosproject/pipelines/basic/BasicInterpreterImpl.java b/pipelines/basic/src/main/java/org/onosproject/pipelines/basic/BasicInterpreterImpl.java
index 8e7b399..5ff38ba 100644
--- a/pipelines/basic/src/main/java/org/onosproject/pipelines/basic/BasicInterpreterImpl.java
+++ b/pipelines/basic/src/main/java/org/onosproject/pipelines/basic/BasicInterpreterImpl.java
@@ -49,7 +49,6 @@
 import static java.lang.String.format;
 import static java.util.stream.Collectors.toList;
 import static org.onlab.util.ImmutableByteSequence.copyFrom;
-import static org.onlab.util.ImmutableByteSequence.fit;
 import static org.onosproject.net.PortNumber.CONTROLLER;
 import static org.onosproject.net.PortNumber.FLOOD;
 import static org.onosproject.net.flow.instructions.Instruction.Type.OUTPUT;
@@ -130,7 +129,7 @@
                 return PiAction.builder()
                         .withId(ACT_SET_EGRESS_PORT_ID)
                         .withParameter(new PiActionParam(ACT_PRM_PORT_ID,
-                                                         fit(copyFrom(port.toLong()), PORT_BITWIDTH)))
+                                                         copyFrom(port.toLong()).fit(PORT_BITWIDTH)))
                         .build();
             } catch (ImmutableByteSequence.ByteSequenceTrimException e) {
                 throw new PiInterpreterException(e.getMessage());
@@ -231,7 +230,7 @@
         try {
             return PiControlMetadata.builder()
                     .withId(PKT_META_EGRESS_PORT_ID)
-                    .withValue(fit(copyFrom(portNumber), PORT_BITWIDTH))
+                    .withValue(copyFrom(portNumber).fit(PORT_BITWIDTH))
                     .build();
         } catch (ImmutableByteSequence.ByteSequenceTrimException e) {
             throw new PiInterpreterException(format(