diff --git a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java
index <HASH>..<HASH> 100644
--- a/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java
+++ b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java
@@ -680,6 +680,16 @@ public class JavaGenerator implements CodeGenerator
             final String lengthJavaType = javaTypeName(lengthEncoding.primitiveType());
             final String byteOrderStr = byteOrderString(lengthEncoding);
 
+            sb.append(String.format(
+                "\n" +
+                indent + "    public static int %sHeaderLength()\n" +
+                indent + "    {\n" +
+                indent + "        return %d;\n" +
+                indent + "    }\n",
+                toLowerFirstChar(propertyName),
+                sizeOfLengthField
+            ));
+
             generateDataEncodeMethods(
                 sb,
                 propertyName,
[Java] Generate header length accessor in in encoders for var data fields. Issue #<I>