提交 7fe3b79f 编写于 作者: J jurgen

HBase model

上级 509fbcd6
......@@ -146,6 +146,15 @@ public class ArrayUtils {
return -1;
}
public static int indexOf(byte[] array, int offset, byte element) {
for (int i = offset; i < array.length; i++) {
if (array[i] == element) {
return i;
}
}
return -1;
}
public static <T> T[] deleteArea(Class<T> type, T[] elements, int from, int to) {
int delCount = to - from + 1;
T[] newArray = (T[]) Array.newInstance(type, elements.length - delCount);
......
......@@ -41,8 +41,8 @@ public class BinaryFormatterHex implements DBDBinaryFormatter {
public String toString(byte[] bytes, int offset, int length)
{
char[] chars = new char[length * 2];
for (int i = offset; i < offset + length; i++) {
String hex = GeneralUtils.byteToHex[bytes[i] & 0x0ff];
for (int i = 0; i < length; i++) {
String hex = GeneralUtils.byteToHex[bytes[offset + i] & 0x0ff];
chars[i * 2] = hex.charAt(0);
chars[i * 2 + 1] = hex.charAt(1);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册