diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/HexString.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/HexString.java
index ddf0f25..eaeed5f 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/HexString.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/HexString.java
@@ -17,8 +17,6 @@
 
 package org.projectfloodlight.openflow.util;
 
-import java.math.BigInteger;
-
 import org.projectfloodlight.openflow.types.U8;
 
 public class HexString {
@@ -86,13 +84,17 @@
         return ret;
     }
 
-    public static long toLong(final String values) throws NumberFormatException {
-        // Long.parseLong() can't handle HexStrings with MSB set. Sigh.
-        BigInteger bi = new BigInteger(values.replaceAll(":", ""), 16);
-        if (bi.bitLength() > 64)
-            throw new NumberFormatException("Input string too big to fit in long: "
-                    + values);
-        return bi.longValue();
+    public static long toLong(String value) throws NumberFormatException {
+        String[] octets = value.split(":");
+        if (octets.length > 8)
+            throw new NumberFormatException("Input string is too big to fit in long: " + value);
+        long l = 0;
+        for (String octet: octets) {
+            if (octet.length() > 2)
+                throw new NumberFormatException("Each colon-separated byte component must consist of 1 or 2 hex digits: " + value);
+            short s = Short.valueOf(octet, 16);
+            l = (l << 8) + s;
+        }
+        return l;
     }
-
 }
diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/util/HexStringTest.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/util/HexStringTest.java
new file mode 100644
index 0000000..360cb5a
--- /dev/null
+++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/util/HexStringTest.java
@@ -0,0 +1,103 @@
+/**
+*    Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
+*    University
+*
+*    Licensed under the Apache License, Version 2.0 (the "License"); you may
+*    not use this file except in compliance with the License. You may obtain
+*    a copy of the License at
+*
+*         http://www.apache.org/licenses/LICENSE-2.0
+*
+*    Unless required by applicable law or agreed to in writing, software
+*    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+*    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+*    License for the specific language governing permissions and limitations
+*    under the License.
+**/
+
+package org.projectfloodlight.openflow.util;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+/**
+ * Does hexstring conversion work?
+ *
+ * @author Rob Sherwood (rob.sherwood@stanford.edu)
+ */
+public class HexStringTest {
+
+    @Test
+    public void testMarshalling() throws Exception {
+        String dpidStr = "00:00:00:23:20:2d:16:71";
+        long dpid = HexString.toLong(dpidStr);
+        String testStr = HexString.toHexString(dpid);
+        assertEquals(dpidStr, testStr);
+    }
+
+    @Test
+    public void testToLong() {
+        String dpidStr = "3e:1f:01:fc:72:8c:63:31";
+        long valid = 0x3e1f01fc728c6331L;
+        long testLong = HexString.toLong(dpidStr);
+        assertEquals(valid, testLong);
+    }
+
+    @Test
+    public void testToLong2() {
+        String dpidStr = "1f:1:fc:72:3:f:31";
+        long valid = 0x1f01fc72030f31L;
+        long testLong = HexString.toLong(dpidStr);
+        assertEquals(valid, testLong);
+    }
+
+    @Test
+    public void testToLongMSB() {
+        String dpidStr = "ca:7c:5e:d1:64:7a:95:9b";
+        long valid = -3856102927509056101L;
+        long testLong = HexString.toLong(dpidStr);
+        assertEquals(valid, testLong);
+    }
+
+    @Test(expected=NumberFormatException.class)
+    public void testToLongErrorTooManyBytes() {
+        HexString.toLong("09:08:07:06:05:04:03:02:01");
+    }
+
+    @Test(expected=NumberFormatException.class)
+    public void testToLongErrorByteValueTooLong() {
+        HexString.toLong("234:01");
+    }
+
+    @Test(expected=NumberFormatException.class)
+    public void testToLongErrorEmptyByte() {
+        HexString.toLong("03::01");
+    }
+
+    @Test(expected=NumberFormatException.class)
+    public void testToLongErrorInvalidHexDigit() {
+        HexString.toLong("ss:01");
+    }
+
+    @Test(expected=NumberFormatException.class)
+    public void testToLongErrorEmptyString() {
+        HexString.toLong("");
+    }
+
+
+    @Test
+    public void testToStringBytes() {
+        byte[] dpid = { 0, 0, 0, 0, 0, 0, 0, -1 };
+        String valid = "00:00:00:00:00:00:00:ff";
+        String testString = HexString.toHexString(dpid);
+        assertEquals(valid, testString);
+    }
+
+    @Test(expected=NumberFormatException.class)
+    public void testFromHexStringError() {
+        String invalidStr = "00:00:00:00:00:00:ffff";
+        HexString.fromHexString(invalidStr);
+    }
+}
+
