diff --git a/src/main/java/com/profiler/common/util/BytesUtils.java b/src/main/java/com/profiler/common/util/BytesUtils.java index dcf7a1946..fe15660fe 100644 --- a/src/main/java/com/profiler/common/util/BytesUtils.java +++ b/src/main/java/com/profiler/common/util/BytesUtils.java @@ -19,13 +19,13 @@ public class BytesUtils { } long[] result = new long[2]; - result[0] = byteToFirstLong(buf); - result[1] = byteToSecondLong(buf); + result[0] = bytesToFirstLong(buf); + result[1] = bytesToSecondLong(buf); return result; } - public static long byteToLong(byte[] buf, int offset) { + public static long bytesToLong(byte[] buf, int offset) { if (buf == null) { throw new NullPointerException("buf must not be null"); } @@ -44,7 +44,7 @@ public class BytesUtils { return rv; } - public static long byteToFirstLong(byte[] buf) { + public static long bytesToFirstLong(byte[] buf) { if (buf == null) { throw new NullPointerException("buf must not be null"); } @@ -63,7 +63,7 @@ public class BytesUtils { return rv; } - public static long byteToSecondLong(byte[] buf) { + public static long bytesToSecondLong(byte[] buf) { if (buf == null) { throw new NullPointerException("buf must not be null"); } diff --git a/src/test/java/com/profiler/common/util/BytesUtilsTest.java b/src/test/java/com/profiler/common/util/BytesUtilsTest.java index 6341fd05f..6febeac84 100644 --- a/src/test/java/com/profiler/common/util/BytesUtilsTest.java +++ b/src/test/java/com/profiler/common/util/BytesUtilsTest.java @@ -31,8 +31,8 @@ public class BytesUtilsTest { Assert.assertEquals(least, longLong[1]); - long bMost = BytesUtils.byteToLong(bytes, 0); - long bLeast = BytesUtils.byteToLong(bytes, 8); + long bMost = BytesUtils.bytesToLong(bytes, 0); + long bLeast = BytesUtils.bytesToLong(bytes, 8); Assert.assertEquals(most, bMost); Assert.assertEquals(least, bLeast);