java_loxi: big refactoring and clean-up
diff --git a/java_gen/pre-written/.classpath b/java_gen/pre-written/.classpath
new file mode 100644
index 0000000..b6bc6ad
--- /dev/null
+++ b/java_gen/pre-written/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="lib" path="lib/netty-3.2.6.Final.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/java_gen/pre-written/.project b/java_gen/pre-written/.project
new file mode 100644
index 0000000..b347bd6
--- /dev/null
+++ b/java_gen/pre-written/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>openflowj-loxi</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/java_gen/pre-written/build.xml b/java_gen/pre-written/build.xml
new file mode 100644
index 0000000..f66d8bc
--- /dev/null
+++ b/java_gen/pre-written/build.xml
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+ <!--
+   Copyright 2011, Big Switch Networks, Inc.
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
+
+<!--
+    The build uses pregenerated Thrift code by default to reduce build
+    dependencies. To generate it locally run the gen-thrift target.
+    If you change the Thrift files be sure to also commit the updated
+    generated code.
+-->
+
+<project default="dist" name="Floodlight">
+    <property name="target" location="target"/>
+    <property name="build" location="${target}/bin"/>
+    <property name="build-test" location="${target}/bin-test"/>
+    <property name="build-coverage" location="${target}/bin-coverage"/>
+    <property name="test-output" location="${target}/test"/>
+    <property name="coverage-output" location="${target}/coverage"/>
+    <property name="source" location="src/main/java"/>
+    <property name="resources" location="src/main/resources/"/>
+    <property name="source-test" location="src/test/java"/>
+    <property name="python-src" location="src/main/python"/>
+    <property name="docs" location="${target}/docs"/>
+    <property name="main-class" value="net.floodlightcontroller.core.Main"/>
+    <property name="floodlight-jar" location="${target}/floodlight.jar"/>
+    <property name="floodlight-test-jar" location="${target}/floodlight-test.jar"/>
+    <property name="thrift.dir" value="${basedir}/src/main/thrift"/>
+    <property name="thrift.out.dir" value="lib/gen-java"/>
+    <property name="thrift.package" value="net/floodlightcontroller/packetstreamer/thrift"/>
+    <property name="ant.build.javac.source" value="1.6"/>
+    <property name="ant.build.javac.target" value="1.6"/>
+    <property name="lib" location="lib"/>
+
+    <patternset id="lib">
+        <include name="netty-3.2.6.Final.jar"/>
+    </patternset>
+
+    <path id="classpath">
+        <fileset dir="${lib}">
+            <patternset refid="lib"/>
+        </fileset>
+    </path>
+
+    <patternset id="lib-cobertura">
+        <include name="cobertura-1.9.4.1.jar"/>
+        <include name="asm-3.0.jar"/>
+        <include name="asm-tree-3.0.jar"/>
+        <include name="oro/jakarta-oro-2.0.8.jar"/>
+        <include name="log4j-1.2.9.jar"/>
+    </patternset>
+    <path id="classpath-cobertura">
+        <fileset dir="${lib}">
+            <patternset refid="lib-cobertura"/>
+    </fileset>
+    </path>
+
+    <patternset id="lib-test">
+        <include name="junit-4.8.2.jar"/>
+        <include name="org.easymock-3.1.jar"/>
+        <include name="objenesis-1.2.jar"/>  <!-- required by easymock to mock classes -->
+        <include name="cglib-nodep-2.2.2.jar"/>    <!-- required by easymock to mock classes -->
+    </patternset>
+    <path id="classpath-test">
+        <fileset dir="${lib}">
+            <patternset refid="lib-test"/>
+            <patternset refid="lib-cobertura"/>
+            <patternset refid="lib"/>
+        </fileset>
+    </path>
+
+    <target name="init">
+        <mkdir dir="${build}"/>
+        <mkdir dir="${build-test}"/>
+        <mkdir dir="${target}/lib"/>
+        <mkdir dir="${thrift.out.dir}"/>
+        <mkdir dir="${test-output}"/>
+    </target>
+
+    <target name="compile" depends="init">
+        <javac includeAntRuntime="false"
+           classpathref="classpath"
+           debug="true"
+           srcdir="${source}:${thrift.out.dir}"
+           destdir="${build}">
+        </javac>
+    </target>
+
+    <target name="compile-tests" depends="compile-test"/>
+    <target name="compile-test" depends="compile">
+        <fileset dir="${resources}"/>
+        <javac includeAntRuntime="false" debug="true"
+           srcdir="${source-test}"
+           classpath="${build}"
+           classpathref="classpath-test"
+           destdir="${build-test}"/>
+    </target>
+
+    <!-- Thrift build based on http://www.flester.com/blog/2009/04/26/using-thrift-from-ant -->
+    <fileset id="thrift.files" dir="${thrift.dir}">
+        <include name="**/*.thrift"/>
+    </fileset>
+
+    <target name="gen-thrift" depends="init">
+        <pathconvert property="thrift.file.list" refid="thrift.files"
+            pathsep=" " dirsep="/">
+        </pathconvert>
+        <echo message="Running thrift generator on ${thrift.file.list}"/>
+        <exec executable="thrift" dir="${basedir}" failonerror="true">
+            <arg line="--strict -v --gen java -o ${thrift.out.dir}/.. ${thrift.file.list}"/>
+        </exec>
+        <!-- Get rid of annoying warnings in thrift java: at annotations -->
+        <echo message="Adding @SuppressWarning annotations"/>
+        <replaceregexp byline="true">
+            <regexp pattern="^public "/>
+            <substitution expression='@SuppressWarnings("all") public '/>
+            <fileset id="thrift.output.files" dir="${thrift.out.dir}/..">
+                <include name="**/*.java"/>
+            </fileset>
+        </replaceregexp>
+    </target>
+
+    <target name="clean">
+        <delete dir="${target}"/>
+    </target>
+
+    <target name="run" depends="dist">
+        <java fork="true" jar="${floodlight-jar}" classpathref="classpath">
+            <jvmarg value="-server"/>
+            <jvmarg value="-Xms1024M"/>
+            <jvmarg value="-Xmx1024M"/>
+        </java>
+    </target>
+
+    <target name="tests" depends="test"/>
+    <target name="test" depends="compile-test">
+        <junit fork="true" forkmode="once"
+           failureproperty="junit.failure"
+           printsummary="on">
+        <sysproperty key="net.sourceforge.cobertura.datafile"
+             file="${target}/cobertura.ser" />
+            <classpath>
+                <pathelement location="${build-coverage}"/>
+                <pathelement location="${build}"/>
+                <pathelement location="${build-test}"/>
+                <pathelement location="${floodlight-jar}"/>
+                <path refid="classpath-test"/>
+            </classpath>
+            <formatter type="brief" usefile="true" />
+            <batchtest todir="${test-output}">
+                <fileset dir="${source-test}">
+                    <exclude name="**/storage/tests/StorageTest.java"/>
+                    <exclude name="**/test/Mock*"/>
+                    <exclude name="**/core/test/**"/>
+                    <exclude name="**/core/module/**"/>
+                </fileset>
+            </batchtest>
+        </junit>
+        <fail if="junit.failure" message="Unit test(s) failed.  See reports!"/>
+    </target>
+
+    <taskdef classpathref="classpath-cobertura" resource="tasks.properties"/>
+    <target name="clean-instrument">
+        <delete file="${target}/cobertura.ser"/>
+        <delete dir="${build-coverage}"/>
+    </target>
+    <target name="instrument" depends="compile,compile-test,clean-instrument">
+      <cobertura-instrument datafile="${target}/cobertura.ser"
+                todir="${build-coverage}"
+                classpathref="classpath-cobertura">
+    <fileset dir="${build}">
+      <include name="**/*.class"/>
+    </fileset>
+      </cobertura-instrument>
+    </target>
+    <target name="coverage-report">
+        <cobertura-report format="html"
+              datafile="${target}/cobertura.ser"
+              destdir="${coverage-output}"
+              srcdir="${source}"/>
+        <cobertura-report format="xml"
+              datafile="${target}/cobertura.ser"
+              destdir="${coverage-output}"
+              srcdir="${source}"/>
+    </target>
+    <target name="coverage" depends="instrument,test,coverage-report"/>
+
+    <target name="dist" depends="compile,compile-test">
+        <jar destfile="${floodlight-jar}" filesetmanifest="mergewithoutmain">
+            <manifest>
+                <attribute name="Main-Class" value="${main-class}"/>
+                <attribute name="Class-Path" value="."/>
+            </manifest>
+            <fileset dir="${build}"/>
+            <fileset dir="${resources}"/>
+            <fileset dir="${python-src}">
+                <include name="**/*.py"/>
+            </fileset>
+            <zipgroupfileset dir="${lib}">
+                <patternset refid="lib"/>
+            </zipgroupfileset>
+        </jar>
+        <jar destfile="${floodlight-test-jar}" filesetmanifest="mergewithoutmain">
+            <manifest>
+                <attribute name="Class-Path" value="."/>
+            </manifest>
+            <fileset dir="${build-test}"/>
+            <fileset dir="${resources}"/>
+            <zipgroupfileset dir="${lib}">
+                <patternset refid="lib-test"/>
+                <patternset refid="lib-cobertura"/>
+            </zipgroupfileset>
+        </jar>
+    </target>
+
+    <target name="javadoc">
+        <javadoc access="protected"
+            author="true"
+            classpathref="classpath"
+            destdir="${docs}"
+            doctitle="Floodlight"
+            nodeprecated="false"
+            nodeprecatedlist="false"
+            noindex="false"
+            nonavbar="false"
+            notree="false"
+            source="1.6"
+            sourcepath="${source}"
+            splitindex="true"
+            use="true"
+            version="true"/>
+    </target>
+
+    <target name="eclipse" depends="init">
+        <pathconvert property="eclipse-lib">
+            <map from="${basedir}/" to=""/>
+            <fileset dir="${lib}">
+                <patternset refid="lib"/>
+                <patternset refid="lib-test"/>
+            </fileset>
+        </pathconvert>
+        <exec executable="${basedir}/setup-eclipse.sh">
+            <arg value="${main-class}"/>
+            <arg value="${eclipse-lib}"/>
+        </exec>
+    </target>
+
+</project>
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFAbstractMessage.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFAbstractMessage.java
deleted file mode 100644
index bc2218f..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFAbstractMessage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Copyright 2013, Big Switch Networks, Inc.
- *
- * LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
- * the following special exception:
- *
- * LOXI Exception
- *
- * As a special exception to the terms of the EPL, you may distribute libraries
- * generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
- * that copyright and licensing notices generated by LoxiGen are not altered or removed
- * from the LoxiGen Libraries and the notice provided below is (i) included in
- * the LoxiGen Libraries, if distributed in source code form and (ii) included in any
- * documentation for the LoxiGen Libraries, if distributed in binary form.
- *
- * Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
- *
- * You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
- * a copy of the EPL at:
- *
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * 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
- * EPL for the specific language governing permissions and limitations
- * under the EPL.
- */
-package org.openflow.protocol;
-
-/**
- * The base interface for all OpenFlow message objects
- */
-
-import org.openflow.types.OFType;
-
-abstract public class OFAbstractMessage implements OFObject {
-    private final OFVersion version;
-    private final OFType type;
-    private int xid;
-
-    public static int MINIMUM_SIZE = 8;
-
-    public OFAbstractMessage(final OFVersion version, final OFType type) {
-        this.version = version;
-        this.type = type;
-    }
-
-    /**
-     * Return the wire format version of this message, e.g., 0x01
-     */
-    OFVersion getVersion() {
-        return version;
-    }
-
-    /**
-     * @return the transction ID for this message
-     */
-    int getXid() {
-        return xid;
-    }
-
-    /**
-     * @param newXid
-     *            Set this transaction ID for this message
-     */
-    void setXid(final int xid) {
-        this.xid = xid;
-    }
-
-    /**
-     * The type that is returned here is agnostic to the underlying wire format
-     *
-     * @return the type of OpenFlow message.
-     */
-    OFType getType() {
-        return type;
-    }
-
-    @Override
-    public int getLength() {
-        return MINIMUM_SIZE;
-    }
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFBsnVportQInQT.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFBsnVportQInQT.java
new file mode 100644
index 0000000..c5b884e
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFBsnVportQInQT.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class OFBsnVportQInQT {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMatchBmap.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMatchBmap.java
new file mode 100644
index 0000000..6e4dc5b
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMatchBmap.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class OFMatchBmap {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java
index 4f31741..c1e4456 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java
@@ -1,13 +1,13 @@
 package org.openflow.protocol;
 
-import org.openflow.types.OFType;
-
 public interface OFMessage {
     int getXid();
 
-    boolean isXidSet();
-
     OFType getType();
 
     OFVersion getVersion();
+
+    interface Builder {
+
+    }
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java
index 24c3314..3f34d9b 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java
@@ -3,6 +3,6 @@
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.openflow.exceptions.OFParseError;
 
-public interface OFMessageReader<T extends OFMessage> {
+public interface OFMessageReader<T> {
     T readFrom(ChannelBuffer bb) throws OFParseError;
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageWriter.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageWriter.java
new file mode 100644
index 0000000..84e5507
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageWriter.java
@@ -0,0 +1,8 @@
+package org.openflow.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.openflow.exceptions.OFParseError;
+
+public interface OFMessageWriter<T> {
+    public int write(ChannelBuffer bb, T message) throws OFParseError;
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java
index 21a4607..4a7557f 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java
@@ -1,5 +1,7 @@
 package org.openflow.protocol;
 
+import org.jboss.netty.buffer.ChannelBuffer;
+
 /**
  *  Base interface of all OpenFlow objects (e.g., messages, actions, stats, etc.)
  *
@@ -10,26 +12,8 @@
  *  malformed packets, for example, for negative testing.
  */
 
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
 
 public interface OFObject {
-    /**
-     * Return a number equal or greater than zero (and currently in OF less than
-     * 65536)
-     *
-     * @return the number of bytes this object will represent on the wire
-     */
-    public int getLength();
-
-    /**
-     * Automatically calculate any lengths and write an openflow object into the
-     * byte buffer.
-     *
-     * @param bb
-     *            A valid byte buffer with sufficient capacity to hold this
-     *            object/
-     */
-    public void writeTo(ChannelBuffer bb) throws OFParseError, OFShortWrite;
+    void writeTo(ChannelBuffer bb);
+    int getLength();
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFTableFeature.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFTableFeature.java
new file mode 100644
index 0000000..114f638
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFTableFeature.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class OFTableFeature {
+    // FIXME implement
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java
index afc0393..7241647 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java
@@ -3,7 +3,7 @@
 public enum OFVersion {
     OF_10(1), OF_11(2), OF_12(3), OF_13(4);
 
-    private final int wireVersion;
+    public final int wireVersion;
 
     OFVersion(final int wireVersion) {
         this.wireVersion = wireVersion;
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/Wildcards.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/Wildcards.java
new file mode 100644
index 0000000..25b2c21
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/Wildcards.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class Wildcards {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/XidGenerator.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/XidGenerator.java
new file mode 100644
index 0000000..0819ac2
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/XidGenerator.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public interface XidGenerator {
+    int nextXid();
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/actions/OFAction.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/actions/OFAction.java
deleted file mode 100644
index f01f8fe..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/actions/OFAction.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.openflow.protocol.actions;
-
-import org.openflow.protocol.OFObject;
-
-public interface OFAction extends OFObject {
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/instructions/OFInstruction.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/instructions/OFInstruction.java
deleted file mode 100644
index 8af305c..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/instructions/OFInstruction.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.openflow.protocol.instructions;
-
-import org.openflow.protocol.OFObject;
-
-public interface OFInstruction extends OFObject {
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java
index 19ced8f..f00e1b4 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java
@@ -1,8 +1,6 @@
 package org.openflow.protocol.match;
 
 import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
 import org.openflow.protocol.types.IpDscp;
 import org.openflow.types.EthType;
 import org.openflow.types.IPv4;
@@ -157,7 +155,7 @@
     }
 
     @Override
-    public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+    public void writeTo(final ChannelBuffer bb) {
         // TODO Auto-generated method stub
 
     }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
index b4eb8cf..aab6dc2 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
@@ -3,7 +3,6 @@
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.openflow.exceptions.OFParseError;
 import org.openflow.exceptions.OFShortRead;
-import org.openflow.exceptions.OFShortWrite;
 import org.openflow.protocol.OFObject;
 
 /**
@@ -90,7 +89,7 @@
     }
 
     @Override
-    public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+    public void writeTo(final ChannelBuffer bb) {
         bb.writeInt(rawValue);
     }
 
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
index 5f51665..f499eac 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
@@ -5,7 +5,6 @@
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.openflow.exceptions.OFParseError;
 import org.openflow.exceptions.OFShortRead;
-import org.openflow.exceptions.OFShortWrite;
 import org.openflow.protocol.OFObject;
 
 /**
@@ -166,7 +165,7 @@
     }
 
     @Override
-    public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+    public void writeTo(final ChannelBuffer bb) {
         bb.writeLong(raw1);
         bb.writeLong(raw2);
     }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
index 4ce19ab..8806bb3 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
@@ -2,7 +2,6 @@
 
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
 import org.openflow.protocol.OFObject;
 import org.openflow.util.HexString;
 
@@ -84,7 +83,7 @@
     }
 
     @Override
-    public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+    public void writeTo(final ChannelBuffer bb) {
         bb.writeInt((int) (rawValue >> 16));
         bb.writeShort((int) rawValue & 0xFFFF);
     }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java
deleted file mode 100644
index d0afb56..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.openflow.types;
-
-public interface OFBsnInterface {
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java
deleted file mode 100644
index 47b403b..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.types;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
-import org.openflow.protocol.OFObject;
-
-public class OFBucket implements OFObject {
-
-    @Override
-    public int getLength() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    @Override
-    public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
-        // TODO Auto-generated method stub
-
-    }
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java
deleted file mode 100644
index d74906f..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.types;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
-import org.openflow.protocol.OFObject;
-
-public class OFPacketQueue implements OFObject {
-
-    @Override
-    public int getLength() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    @Override
-    public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
-        // TODO Auto-generated method stub
-
-    }
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java b/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
index e8eeebd..dab6ff2 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
@@ -3,17 +3,32 @@
 import java.util.List;
 
 import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.protocol.actions.OFAction;
-import org.openflow.protocol.instructions.OFInstruction;
+import org.openflow.protocol.OFBsnInterface;
+import org.openflow.protocol.OFBsnVportQInQ;
+import org.openflow.protocol.OFBsnVportQInQT;
+import org.openflow.protocol.OFBucket;
+import org.openflow.protocol.OFFlowStatsEntry;
+import org.openflow.protocol.OFGroupDescStatsEntry;
+import org.openflow.protocol.OFGroupStatsEntry;
+import org.openflow.protocol.OFHelloElem;
+import org.openflow.protocol.OFMeterFeatures;
+import org.openflow.protocol.OFMeterStats;
+import org.openflow.protocol.OFPacketQueue;
+import org.openflow.protocol.OFPortStatsEntry;
+import org.openflow.protocol.OFQueueStatsEntry;
+import org.openflow.protocol.OFTableFeature;
+import org.openflow.protocol.OFTableFeatures;
+import org.openflow.protocol.OFTableStatsEntry;
+import org.openflow.protocol.action.OFAction;
+import org.openflow.protocol.instruction.OFInstruction;
 import org.openflow.protocol.match.Match;
-import org.openflow.types.OFBsnInterface;
-import org.openflow.types.OFBucket;
 import org.openflow.types.OFFlowModCmd;
 import org.openflow.types.OFHelloElement;
 import org.openflow.types.OFMeterBand;
-import org.openflow.types.OFPacketQueue;
 import org.openflow.types.OFPhysicalPort;
 
+import com.google.common.base.Charsets;
+
 /**
  * Collection of helper functions for reading and writing into ChannelBuffers
  *
@@ -90,4 +105,212 @@
         return null;
     }
 
+    public static void writeOFMatch(ChannelBuffer bb, Match match) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeList(ChannelBuffer bb, List<?> ports) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeOFFlowModCmd(ChannelBuffer bb, OFFlowModCmd command) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static String readFixedLengthString(ChannelBuffer bb, int length) {
+        byte[] dst = new byte[length];
+        bb.readBytes(dst, 0, length);
+        return new String(dst, Charsets.US_ASCII);
+    }
+
+    public static void writeFixedLengthString(ChannelBuffer bb, String string, int length) {
+        int l = string.length();
+        if(l > length) {
+            throw new IllegalArgumentException("Error writing string: length="+l+" > max Length="+length);
+        }
+        bb.writeBytes(string.getBytes(Charsets.US_ASCII));
+        if(l < length) {
+            bb.writeZero(length - l);
+        }
+    }
+
+    public static void writeBsnInterfaceList(ChannelBuffer bb, List<OFBsnInterface> interfaces) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeTableFeatureList(ChannelBuffer bb,
+            List<OFTableFeature> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeBsnInterface(ChannelBuffer bb,
+            List<OFBsnInterface> interfaces) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeFlowStatsEntry(ChannelBuffer bb,
+            List<OFFlowStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFFlowStatsEntry> readFlowStatsEntry(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeTableStatsEntryList(ChannelBuffer bb,
+            List<OFTableStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFTableStatsEntry> readTableStatsEntryList(
+            ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeFlowStatsEntryList(ChannelBuffer bb,
+            List<OFFlowStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeGroupDescStatsEntryList(ChannelBuffer bb,
+            List<OFGroupDescStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFGroupDescStatsEntry> readGroupDescStatsEntryList(
+            ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFBsnVportQInQT(ChannelBuffer bb,
+            OFBsnVportQInQT vport) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeMeterBandList(ChannelBuffer bb,
+            List<OFMeterBand> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static int writeActionsList(ChannelBuffer bb, List<OFAction> actions) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public static OFBsnVportQInQ readOFBsnVportQInQ(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writePortStatsEntryList(ChannelBuffer bb,
+            List<OFPortStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void write(ChannelBuffer bb, OFPhysicalPort desc) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFBsnVportQInQ(ChannelBuffer bb,
+            OFBsnVportQInQ vport) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeHelloElemList(ChannelBuffer bb,
+            List<OFHelloElem> elements) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFGroupStatsEntry> readGroupStatsEntryList(
+            ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeGroupStatsEntryList(ChannelBuffer bb,
+            List<OFGroupStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFQueueStatsEntry> readQueueStatsEntryList(
+            ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeQueueStatsEntryList(ChannelBuffer bb,
+            List<OFQueueStatsEntry> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static OFMeterFeatures readOFMeterFeatures(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFMeterFeatures(ChannelBuffer bb,
+            OFMeterFeatures features) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeMeterStatsList(ChannelBuffer bb,
+            List<OFMeterStats> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeTableFeaturesList(ChannelBuffer bb,
+            List<OFTableFeatures> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
+
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/LengthCountingPseudoChannelBuffer.java b/java_gen/pre-written/src/main/java/org/openflow/util/LengthCountingPseudoChannelBuffer.java
new file mode 100644
index 0000000..bd0adce
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/util/LengthCountingPseudoChannelBuffer.java
@@ -0,0 +1,673 @@
+package org.openflow.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.GatheringByteChannel;
+import java.nio.channels.ScatteringByteChannel;
+import java.nio.charset.Charset;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBufferFactory;
+import org.jboss.netty.buffer.ChannelBufferIndexFinder;
+
+public class LengthCountingPseudoChannelBuffer implements ChannelBuffer {
+
+    int writerIndex = 0;
+    private int markedWriterIndex;
+
+    @Override
+    public ChannelBufferFactory factory() {
+        return null;
+    }
+
+    @Override
+    public int capacity() {
+        return Integer.MAX_VALUE;
+    }
+
+    @Override
+    public ByteOrder order() {
+        return ByteOrder.BIG_ENDIAN;
+    }
+
+    @Override
+    public boolean isDirect() {
+        return true;
+    }
+
+    @Override
+    public int readerIndex() {
+        return 0;
+    }
+
+    @Override
+    public void readerIndex(int readerIndex) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int writerIndex() {
+        return writerIndex;
+    }
+
+    @Override
+    public void writerIndex(int writerIndex) {
+        this.writerIndex = writerIndex;
+    }
+
+    @Override
+    public void setIndex(int readerIndex, int writerIndex) {
+        if(readerIndex != 0)
+            throw new UnsupportedOperationException();
+        this.writerIndex = writerIndex;
+    }
+
+    @Override
+    public int readableBytes() {
+        return writerIndex;
+    }
+
+    @Override
+    public int writableBytes() {
+        return Integer.MAX_VALUE - writerIndex;
+    }
+
+    @Override
+    public boolean readable() {
+        return writerIndex > 0;
+    }
+
+    @Override
+    public boolean writable() {
+        return writerIndex < Integer.MAX_VALUE;
+    }
+
+    @Override
+    public void clear() {
+        writerIndex = 0;
+
+    }
+
+    @Override
+    public void markReaderIndex() {
+    }
+
+    @Override
+    public void resetReaderIndex() {
+    }
+
+    @Override
+    public void markWriterIndex() {
+        markedWriterIndex = writerIndex;
+    }
+
+    @Override
+    public void resetWriterIndex() {
+        writerIndex = markedWriterIndex;
+    }
+
+    @Override
+    public void discardReadBytes() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void ensureWritableBytes(int writableBytes) {
+        if(!((Integer.MAX_VALUE - writableBytes) > writerIndex))
+            throw new IllegalStateException();
+    }
+
+    @Override
+    public byte getByte(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public short getUnsignedByte(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public short getShort(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getUnsignedShort(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getMedium(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getUnsignedMedium(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getInt(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getUnsignedInt(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getLong(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public char getChar(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public float getFloat(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public double getDouble(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, ChannelBuffer dst) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, ChannelBuffer dst, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, byte[] dst) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, byte[] dst, int dstIndex, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, ByteBuffer dst) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void getBytes(int index, OutputStream out, int length)
+            throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getBytes(int index, GatheringByteChannel out, int length)
+            throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setByte(int index, int value) {
+    }
+
+    @Override
+    public void setShort(int index, int value) {
+    }
+
+    @Override
+    public void setMedium(int index, int value) {
+    }
+
+    @Override
+    public void setInt(int index, int value) {
+    }
+
+    @Override
+    public void setLong(int index, long value) {
+    }
+
+    @Override
+    public void setChar(int index, int value) {
+    }
+
+    @Override
+    public void setFloat(int index, float value) {
+    }
+
+    @Override
+    public void setDouble(int index, double value) {
+    }
+
+    @Override
+    public void setBytes(int index, ChannelBuffer src) {
+    }
+
+    @Override
+    public void setBytes(int index, ChannelBuffer src, int length) {
+    }
+
+    @Override
+    public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) {
+    }
+
+    @Override
+    public void setBytes(int index, byte[] src) {
+    }
+
+    @Override
+    public void setBytes(int index, byte[] src, int srcIndex, int length) {
+    }
+
+    @Override
+    public void setBytes(int index, ByteBuffer src) {
+
+    }
+
+    @Override
+    public int setBytes(int index, InputStream in, int length)
+            throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int setBytes(int index, ScatteringByteChannel in, int length)
+            throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setZero(int index, int length) {
+    }
+
+    @Override
+    public byte readByte() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public short readUnsignedByte() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public short readShort() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int readUnsignedShort() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int readMedium() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int readUnsignedMedium() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int readInt() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long readUnsignedInt() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long readLong() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public char readChar() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public float readFloat() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public double readDouble() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer readBytes(int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @Deprecated
+    public ChannelBuffer readBytes(ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer readSlice(int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @Deprecated
+    public
+    ChannelBuffer readSlice(ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(ChannelBuffer dst) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(ChannelBuffer dst, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(ChannelBuffer dst, int dstIndex, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(byte[] dst) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(byte[] dst, int dstIndex, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(ByteBuffer dst) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void readBytes(OutputStream out, int length) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int readBytes(GatheringByteChannel out, int length)
+            throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void skipBytes(int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @Deprecated
+    public int skipBytes(ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void writeByte(int value) {
+        writerIndex++;
+    }
+
+    @Override
+    public void writeShort(int value) {
+    writerIndex += 2;
+}
+
+@Override
+public void writeMedium(int value) {
+    writerIndex += 3;
+}
+
+@Override
+public void writeInt(int value) {
+    writerIndex += 4;
+}
+
+@Override
+public void writeLong(long value) {
+    writerIndex += 8;
+}
+
+
+    @Override
+    public void writeChar(int value) {
+        writeShort(value);
+    }
+
+    @Override
+    public void writeFloat(float value) {
+        writeInt(Float.floatToIntBits(value));
+    }
+
+    @Override
+    public void writeDouble(double value) {
+        writeLong(Double.doubleToLongBits(value));
+
+    }
+
+    @Override
+    public void writeBytes(ChannelBuffer src) {
+        writerIndex += src.readableBytes();
+
+    }
+
+    @Override
+    public void writeBytes(ChannelBuffer src, int length) {
+        writerIndex += src.readableBytes();
+
+    }
+
+    @Override
+    public void writeBytes(ChannelBuffer src, int srcIndex, int length) {
+        writerIndex += length;
+    }
+
+    @Override
+    public void writeBytes(byte[] src) {
+        writerIndex += src.length;
+
+    }
+
+    @Override
+    public void writeBytes(byte[] src, int srcIndex, int length) {
+        writerIndex += length;
+    }
+
+    @Override
+    public void writeBytes(ByteBuffer src) {
+        writerIndex += src.remaining();
+
+    }
+
+    @Override
+    public int writeBytes(InputStream in, int length) throws IOException {
+        writerIndex += length;
+        return length;
+    }
+
+    @Override
+    public int writeBytes(ScatteringByteChannel in, int length)
+            throws IOException {
+        writerIndex += length;
+        return length;
+    }
+
+    @Override
+    public void writeZero(int length) {
+        writerIndex += length;
+
+    }
+
+    @Override
+    public int indexOf(int fromIndex, int toIndex, byte value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int indexOf(int fromIndex, int toIndex,
+            ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int bytesBefore(byte value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int bytesBefore(ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int bytesBefore(int length, byte value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int bytesBefore(int length, ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int bytesBefore(int index, int length, byte value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int bytesBefore(int index, int length,
+            ChannelBufferIndexFinder indexFinder) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer copy() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer copy(int index, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer slice() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer slice(int index, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ChannelBuffer duplicate() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ByteBuffer toByteBuffer() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ByteBuffer toByteBuffer(int index, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ByteBuffer[] toByteBuffers() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ByteBuffer[] toByteBuffers(int index, int length) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean hasArray() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public byte[] array() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int arrayOffset() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String toString(Charset charset) {
+        return "LengthCountingPseudoChannelBuffer(length="+writerIndex+")";
+    }
+
+    @Override
+    public String toString(int index, int length, Charset charset) {
+        return toString();
+    }
+
+    @Override
+    @Deprecated
+    public String toString(String charsetName) {
+        return toString();
+    }
+
+    @Override
+    @Deprecated
+    public String toString(String charsetName,
+            ChannelBufferIndexFinder terminatorFinder) {
+        return toString();
+    }
+
+    @Override
+    @Deprecated
+    public String toString(int index, int length, String charsetName) {
+        return toString();
+    }
+
+    @Override
+    @Deprecated
+    public
+    String toString(int index, int length, String charsetName,
+            ChannelBufferIndexFinder terminatorFinder) {
+        return toString();
+    }
+
+    @Override
+    public int compareTo(ChannelBuffer buffer) {
+        throw new UnsupportedOperationException();
+
+    }
+
+}