import java.util.Arrays;
import org.opendaylight.controller.sal.utils.NetUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* BitBufferHelper class that provides utility methods to
*
*/
public abstract class BitBufferHelper {
+ protected static final Logger logger = LoggerFactory
+ .getLogger(BitBufferHelper.class);
public static long ByteMask = 0xFF;
throw new Exception(
"Container is too small for the number of requested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
return (data[0]);
throw new Exception(
"Container is too small for the number of requested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
return (short) toNumber(data);
throw new Exception(
"Container is too small for the number of requested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
return (int) toNumber(data);
throw new Exception(
"Container is too small for the number of requested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
return (long) toNumber(data);
throw new Exception(
"Container is too small for the number of requested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
int startOffset = data.length * NetUtils.NumBitsInAByte - numBits;
throw new Exception(
"Container is too small for the number of requiested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
int startOffset = data.length * NetUtils.NumBitsInAByte - numBits;
throw new Exception(
"Container is too small for the number of requested bits");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
if (numBits > data.length * NetUtils.NumBitsInAByte) {
throw new Exception(
"Trying to read more bits than contained in the data buffer");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("",e);
}
}
int startOffset = data.length * NetUtils.NumBitsInAByte - numBits;