From dea70ae4fbbaf9f5343bdf5bce826c5712e748a3 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 12 Dec 2014 15:40:32 +0000
Subject: [PATCH] OPENDJ-1602 (CR-5566) New pluggable storage based backend

---
 opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java b/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java
index 04f2533..411ecd4 100644
--- a/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java
+++ b/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java
@@ -773,7 +773,6 @@
     {
       return (char) b;
     }
-
     return ' ';
   }
 
@@ -813,7 +812,6 @@
    * array using hexadecimal characters and a space between each byte.
    *
    * @param  b  The byte array containing the data.
-   *
    * @return  A string representation of the contents of the provided byte
    *          array using hexadecimal characters.
    */
@@ -837,6 +835,34 @@
     return buffer.toString();
   }
 
+  /**
+   * Retrieves a string representation of the contents of the provided byte
+   * sequence using hexadecimal characters and a space between each byte.
+   *
+   * @param b The byte sequence containing the data.
+   * @return A string representation of the contents of the provided byte
+   *         sequence using hexadecimal characters.
+   */
+  public static String bytesToHex(ByteSequence b)
+  {
+    if ((b == null) || (b.length() == 0))
+    {
+      return "";
+    }
+
+    int arrayLength = b.length();
+    StringBuilder buffer = new StringBuilder((arrayLength - 1) * 3 + 2);
+    buffer.append(byteToHex(b.byteAt(0)));
+
+    for (int i=1; i < arrayLength; i++)
+    {
+      buffer.append(" ");
+      buffer.append(byteToHex(b.byteAt(i)));
+    }
+
+    return buffer.toString();
+  }
+
 
 
   /**
@@ -4199,6 +4225,7 @@
         }
         catch (NamingException ignored)
         {
+          // ignore
         }
       }
     }
@@ -4219,6 +4246,7 @@
     }
     catch (InterruptedException wokenUp)
     {
+      // ignore
     }
   }
 
@@ -4348,7 +4376,6 @@
   {
     return new Iterable<T>()
     {
-
       @Override
       public Iterator<T> iterator()
       {

--
Gitblit v1.10.0