@@ -142,30 +142,34 @@ private StructStackItem(final int namedFieldCounter, final int startStructureOff
142142 public static final int CODE_RESET_COUNTER = 0x0E ;
143143
144144 /**
145- * The Byte code shows that field should be processed by custom field type processor.
145+ * The Byte code shows that field should be processed by custom field type
146+ * processor.
146147 */
147148 public static final int CODE_CUSTOMTYPE = 0x0F ;
148149
149150 /**
150151 * The Byte-Code Flag shows that the field is a named one.
151152 */
152153 public static final int FLAG_NAMED = 0x10 ;
153- /**
154- * The Byte-Code Flag shows that the field is an array which size is defined
155- * by an expression or the array is unsized and must be read till the end of a
156- * stream.
157- */
158- public static final int FLAG_EXPRESSION_OR_WHOLESTREAM = 0x20 ;
154+
159155 /**
160156 * The Byte-Code Flag shows that the field is an array but it must be omitted
161157 * for unlimited field arrays.
162158 */
163- public static final int FLAG_ARRAY = 0x40 ;
159+ public static final int FLAG_ARRAY = 0x20 ;
160+
164161 /**
165162 * The Byte-Code Flag shows that a multi-byte field must be decoded as
166163 * Little-endian one.
167164 */
168- public static final int FLAG_LITTLE_ENDIAN = 0x80 ;
165+ public static final int FLAG_LITTLE_ENDIAN = 0x40 ;
166+
167+ /**
168+ * The Byte-Code Flag shows that the field is an array which size is defined
169+ * by an expression or the array is unsized and must be read till the end of a
170+ * stream.
171+ */
172+ public static final int FLAG_EXPRESSION_OR_WHOLESTREAM = 0x80 ;
169173
170174 public static JBBPCompiledBlock compile (final String script ) throws IOException {
171175 return compile (script , null );
@@ -175,7 +179,8 @@ public static JBBPCompiledBlock compile(final String script) throws IOException
175179 * Compile a text script into its byte code representation/
176180 *
177181 * @param script a text script to be compiled, must not be null.
178- * @param customTypeFieldProcessor processor to process custom type fields, can be null
182+ * @param customTypeFieldProcessor processor to process custom type fields,
183+ * can be null
179184 * @return a compiled block for the script.
180185 * @throws IOException it will be thrown for an inside IO error.
181186 * @throws JBBPException it will be thrown for any logical or work exception
@@ -215,7 +220,7 @@ public static JBBPCompiledBlock compile(final String script, final JBBPCustomFie
215220 boolean extraFieldPresented = false ;
216221 int extraField = -1 ;
217222 int customTypeFieldIndex = -1 ;
218-
223+
219224 // check that the field is not in the current structure which is a whole stream one
220225 if ((code & 0xF ) != CODE_STRUCT_END && fieldUnrestrictedArrayOffset >= 0 && (structureStack .isEmpty () || structureStack .get (structureStack .size () - 1 ).startStructureOffset != fieldUnrestrictedArrayOffset )) {
221226 throw new JBBPCompilationException ("Attempt to read after a 'till-the-end' field" , token );
@@ -397,8 +402,8 @@ public static JBBPCompiledBlock compile(final String script, final JBBPCustomFie
397402 if (extraFieldPresented ) {
398403 offset += writePackedInt (out , extraField );
399404 }
400-
401- if (customTypeFieldIndex >= 0 ) {
405+
406+ if (customTypeFieldIndex >= 0 ) {
402407 offset += writePackedInt (out , customTypeFieldIndex );
403408 }
404409
@@ -506,7 +511,8 @@ private static int writePackedInt(final OutputStream out, final int value) throw
506511 * The Method prepares a byte-code for a token field type and modifiers.
507512 *
508513 * @param token a token to be processed, must not be null
509- * @param customTypeFieldProcessor custom type field processor for the parser, it can be null
514+ * @param customTypeFieldProcessor custom type field processor for the parser,
515+ * it can be null
510516 * @return the prepared byte code for the token
511517 */
512518 private static int prepareCodeForToken (final JBBPToken token , final JBBPCustomFieldTypeProcessor customTypeFieldProcessor ) {
0 commit comments