Remove dependecies on bgpcep concepts/util
[controller.git] / opendaylight / netconf / netconf-util / src / main / java / org / opendaylight / controller / netconf / util / messages / NetconfMessageHeader.java
index ccf7a3fbd250425a526d9a6761fcb373a4c7a532..a61541b9146556f7b71e0766e0c8b99a65a81fd9 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.netconf.util.messages;
 
 import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
-import org.opendaylight.protocol.util.ByteArray;
 
 import java.nio.ByteBuffer;
 
@@ -27,10 +26,6 @@ public final class NetconfMessageHeader {
 
     private static final byte headerEnd = (byte) 0x0a;
 
-    public static final int MIN_HEADER_LENGTH = 4; // bytes
-
-    public static final int MAX_HEADER_LENGTH = 13; // bytes
-
     private boolean parsed = false;
 
     public NetconfMessageHeader() {
@@ -43,8 +38,7 @@ public final class NetconfMessageHeader {
         // the length should be only numbers and therefore easily parsed with
         // ASCII
         this.length = Long.parseLong(Charsets.US_ASCII.decode(
-                ByteBuffer.wrap(ByteArray.subByte(bytes, headerBegin.length, bytes.length - headerBegin.length - 1)))
-                .toString());
+                ByteBuffer.wrap(bytes, headerBegin.length, bytes.length - headerBegin.length - 1)).toString());
         Preconditions.checkState(this.length < Integer.MAX_VALUE && this.length > 0);
         this.parsed = true;
         return this;