Refactoring datastore package
Preparation to make datastore replacable
- Extract datastore interfaces
- Add multi Read/Write/Remove
- Add a method to walk over RCTable
- Refactor serialize/deserialize RCObject
- Localize dependency to JRAMCloud
- Separate RAMCloud specific code into ramcloud package
- Remove dependency to RAMCloud exception classes
- Remove RC prefix from non RAMCloud specific code
- Cosmetics and update sample/test code
- reflect Naoki's comment
- more cosmetic fixes
- reordered OPERATION enums
- removed no longer used code
- follow pmd, etc. where easily possible
Change-Id: I6f9153d705600447acf48a64f713c654c9f26713
diff --git a/src/main/java/net/onrc/onos/datastore/utils/ByteArrayUtil.java b/src/main/java/net/onrc/onos/datastore/utils/ByteArrayUtil.java
index 96f8743..c13d7ea 100644
--- a/src/main/java/net/onrc/onos/datastore/utils/ByteArrayUtil.java
+++ b/src/main/java/net/onrc/onos/datastore/utils/ByteArrayUtil.java
@@ -4,13 +4,35 @@
public class ByteArrayUtil {
+ // Suppresses default constructor, ensuring non-instantiability.
+ private ByteArrayUtil() {}
+
+ /**
+ * Returns a StringBuffer with each byte in {@code bytes}
+ * converted to a String with {@link Integer#toHexString(int)},
+ * separated by {@code sep}.
+ *
+ * @param bytes byte array to convert
+ * @param sep separator between each bytes
+ * @return {@code bytes} converted to a StringBuffer
+ */
public static StringBuffer toHexStringBuffer(final byte[] bytes,
final String sep) {
return toHexStringBuffer(bytes, sep, new StringBuffer());
}
+ /**
+ * Returns a StringBuffer with each byte in {@code bytes}
+ * converted to a String with {@link Integer#toHexString(int)},
+ * separated by {@code sep}.
+ *
+ * @param bytes byte array to convert
+ * @param sep separator between each bytes
+ * @param buf StringBuffer to append to.
+ * @return {@code buf}
+ */
public static StringBuffer toHexStringBuffer(final byte[] bytes,
- final String sep, StringBuffer buf) {
+ final String sep, final StringBuffer buf) {
if (bytes == null) {
return buf;
}