Skip to content

Commit 29d5d60

Browse files
committed
fixed typos
1 parent 953710d commit 29d5d60

File tree

14 files changed

+26
-26
lines changed

14 files changed

+26
-26
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Parsed {@Bin(type = BinType.BIT_ARRAY)byte[] parsed;}
8181
Parsed parsedBits = JBBPParser.prepare("bit:1 [_] parsed;").parse(new byte[]{1,2,3,4,5}).mapTo(Parsed.class);
8282
```
8383

84-
# More compex example with features added as of 1.1.0
84+
# More complex example with features added as of 1.1.0
8585
The Example shows how to parse a byte written in non-standard MSB0 order (Java has LSB0 bit order) to bit fields, print its values and pack fields back
8686
```Java
8787
class Flags {
@@ -116,7 +116,7 @@ The Example will print in console the text below
116116
;--------------------------------------------------------------------------------
117117
```
118118
# Fields
119-
Every field can have case insensitive name which should not contain '.' (because it is reserved for links to structure field values) and '#'(because it is also reserver for inside usage).
119+
Every field can have case insensitive name which should not contain '.' (because it is reserved for links to structure field values) and '#'(because it is also reserved for inside usage).
120120
Field name must not be started by a number or chars '$' and '_'. *Field names are case insensitive!*
121121
```
122122
int someNamedField;
@@ -137,7 +137,7 @@ The Framework provides support for arrays and structures. Just keep in mind that
137137
it is possible to define processors for own custom data types, for instance you can take a look at [case processing three byte unsigned integer types](https://github.com/raydac/java-binary-block-parser/blob/master/src/test/java/com/igormaznitsa/jbbp/it/CustomThreeByteIntegerTypeTest.java).
138138

139139
### Float and Double types
140-
The Parser doesn't support Java float and double types out of the box. But it can be implemented through custom type processor. [there is written example and test and the code can be copy pasted](https://github.com/raydac/java-binary-block-parser/blob/master/src/test/java/com/igormaznitsa/jbbp/it/FloatAndDoubleTypesTest.java).
140+
The Parser does not support Java float and double types out of the box. But it can be implemented through custom type processor. [there is written example and test and the code can be copy pasted](https://github.com/raydac/java-binary-block-parser/blob/master/src/test/java/com/igormaznitsa/jbbp/it/FloatAndDoubleTypesTest.java).
141141

142142
## Variable fields
143143
If you have some data which structure is variable then you can use the `var` type for defined field and process reading of the data manually with custom [JBBPVarFieldProcessor](https://github.com/raydac/java-binary-block-parser/blob/master/src/main/java/com/igormaznitsa/jbbp/JBBPVarFieldProcessor.java) instance.
@@ -194,7 +194,7 @@ You can use commentaries inside a parser script, the parser supports the only co
194194
Inside expression you can use field names and field paths, also you can use the special macros '$$' which represents the current input stream byte counter, all fields started with '$' will be recognized by the parser as special user defined variables and it will be requesting them from special user defined provider. If the array size contains the only '_' symbol then the field or structure will not have defined size and whole stream will be read.
195195

196196
# How to get result of parsing
197-
The Result of parsing is an instance of com.igormaznitsa.jbbp.model.JBBPFieldStruct class which represents the root invisible structure for the parsed data and you can use its inside methods to find desired fields for their names, paths or classes. All Fields are successors of com.igormaznitsa.jbbp.model.JBBPAbstractField class. To increase comfort, it is easier to use mapping to classes when the mapper automaticaly places values to fields of a Java class.
197+
The Result of parsing is an instance of com.igormaznitsa.jbbp.model.JBBPFieldStruct class which represents the root invisible structure for the parsed data and you can use its inside methods to find desired fields for their names, paths or classes. All Fields are successors of com.igormaznitsa.jbbp.model.JBBPAbstractField class. To increase comfort, it is easier to use mapping to classes when the mapper automatically places values to fields of a Java class.
198198

199199
# Example
200200
The Example below shows how to parse a PNG file with the JBBP parser (the example taken from tests)

jbbp-plugins/jbbp-gradle/src/main/java/com/igormaznitsa/jbbp/plugin/gradle/JBBPExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class JBBPExtension {
6464
public String inEncoding = "UTF-8";
6565

6666
/**
67-
* Encoding for text ouptut.
67+
* Encoding for text output.
6868
*/
6969
public String outEncoding = "UTF-8";
7070

jbbp-plugins/jbbp-plugin-common/src/main/java/com/igormaznitsa/jbbp/plugin/common/utils/CommonUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static String ensureEncodingName(@Nullable final String charsetName) {
4545
try {
4646
return (charsetName == null) ? defaultCharset.name() : Charset.forName(charsetName.trim()).name();
4747
} catch (IllegalCharsetNameException ex) {
48-
throw new IllegalArgumentException("Can't recognoze charset for name '" + charsetName + '\'');
48+
throw new IllegalArgumentException("Can't recognize charset for name '" + charsetName + '\'');
4949
}
5050
}
5151

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/conversion/CompiledBlockVisitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected boolean isFlagSkipRemainingFieldsIfEOF() {
6363
}
6464

6565
/**
66-
* The Main method of the class, it processes copiled block and make calls to template methods.
66+
* The Main method of the class, it processes compiled block and make calls to template methods.
6767
*
6868
* @return the instance of the visitor, must not be null
6969
*/
@@ -232,7 +232,7 @@ public void visitPrimitiveField(int offsetInCompiledBlock, int primitiveType, JB
232232
public void visitVarField(int offsetInCompiledBlock, JBBPNamedFieldInfo nullableNameFieldInfo, JBBPByteOrder byteOrder, boolean readWholeStreamIntoArray, JBBPIntegerValueEvaluator nullableArraySize, JBBPIntegerValueEvaluator extraDataValueEvaluator) {
233233
}
234234

235-
public void visitCustomField(int offsetInCompiledBlock, JBBPFieldTypeParameterContainer notNullfieldType, JBBPNamedFieldInfo nullableNameFieldInfo, JBBPByteOrder byteOrder, boolean readWholeStream, JBBPIntegerValueEvaluator nullableArraySizeEvaluator, JBBPIntegerValueEvaluator extraDataValueEvaluator) {
235+
public void visitCustomField(int offsetInCompiledBlock, JBBPFieldTypeParameterContainer notNullFieldType, JBBPNamedFieldInfo nullableNameFieldInfo, JBBPByteOrder byteOrder, boolean readWholeStream, JBBPIntegerValueEvaluator nullableArraySizeEvaluator, JBBPIntegerValueEvaluator extraDataValueEvaluator) {
236236
}
237237

238238
public void visitBitField(int offsetInCompiledBlock, JBBPNamedFieldInfo nullableNameFieldInfo, JBBPIntegerValueEvaluator notNullFieldSize, JBBPIntegerValueEvaluator nullableArraySize) {

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/conversion/ExpressionEvaluatorVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public interface ExpressionEvaluatorVisitor {
5757
ExpressionEvaluatorVisitor visitOperator(Operator operator);
5858

5959
/**
60-
* Visit integer costant
60+
* Visit integer constant
6161
*
6262
* @param value integer constant
6363
* @return the visitor instance, must not be null

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/conversion/JBBPToJava6Converter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ private String makeModifier(final JBBPNamedFieldInfo nullableNameFieldInfo) {
416416
}
417417

418418
@Override
419-
public void visitCustomField(final int offsetInCompiledBlock, final JBBPFieldTypeParameterContainer notNullfieldType, final JBBPNamedFieldInfo nullableNameFieldInfo, final JBBPByteOrder byteOrder, final boolean readWholeStream, final JBBPIntegerValueEvaluator nullableArraySizeEvaluator, final JBBPIntegerValueEvaluator extraDataValueEvaluator) {
419+
public void visitCustomField(final int offsetInCompiledBlock, final JBBPFieldTypeParameterContainer notNullFieldType, final JBBPNamedFieldInfo nullableNameFieldInfo, final JBBPByteOrder byteOrder, final boolean readWholeStream, final JBBPIntegerValueEvaluator nullableArraySizeEvaluator, final JBBPIntegerValueEvaluator extraDataValueEvaluator) {
420420
this.flagSet.set(this.flagSet.get() | FLAG_DETECTED_CUSTOM_FIELDS);
421421

422422
registerNamedField(nullableNameFieldInfo, FieldType.CUSTOM);
@@ -439,7 +439,7 @@ public void visitCustomField(final int offsetInCompiledBlock, final JBBPFieldTyp
439439

440440
this.specialSection.printf("private static final JBBPFieldTypeParameterContainer %s = %s;%n",
441441
specialFieldName_typeParameterContainer,
442-
"new JBBPFieldTypeParameterContainer(JBBPByteOrder." + notNullfieldType.getByteOrder().name() + ",\"" + notNullfieldType.getTypeName() + "\"," + (notNullfieldType.getExtraData() == null ? "null" : "\"" + notNullfieldType.getExtraData() + "\"") + ")"
442+
"new JBBPFieldTypeParameterContainer(JBBPByteOrder." + notNullFieldType.getByteOrder().name() + ",\"" + notNullFieldType.getTypeName() + "\"," + (notNullFieldType.getExtraData() == null ? "null" : "\"" + notNullFieldType.getExtraData() + "\"") + ")"
443443
);
444444

445445
processSkipRemainingFlag();

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/tokenizer/JBBPTokenizer.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public final class JBBPTokenizer implements Iterable<JBBPToken>, Iterator<JBBPTo
7575
* The Field contains deferred error.
7676
*/
7777
private JBBPTokenizerException detectedException;
78-
private int lastCharSubstingFound = -1;
78+
private int lastCharSubstringFound = -1;
7979

8080
/**
8181
* Constructor.
@@ -135,9 +135,9 @@ private void readNextItem() {
135135
final String groupName = this.matcher.group(4);
136136
final String groupEnder = this.matcher.group(5);
137137

138-
final String skipString = this.processingString.substring(Math.max(this.lastCharSubstingFound, 0), matcher.start()).trim();
138+
final String skipString = this.processingString.substring(Math.max(this.lastCharSubstringFound, 0), matcher.start()).trim();
139139
if (skipString.length() != 0 && !skipString.startsWith("//")) {
140-
this.detectedException = new JBBPTokenizerException(skipString, Math.max(this.lastCharSubstingFound, 0));
140+
this.detectedException = new JBBPTokenizerException(skipString, Math.max(this.lastCharSubstringFound, 0));
141141
} else {
142142
JBBPTokenType type = JBBPTokenType.ATOM;
143143

@@ -221,15 +221,15 @@ private void readNextItem() {
221221
}
222222

223223
this.nextItem = new JBBPToken(type, position, parsedType, groupArrayLength, fieldName);
224-
lastCharSubstingFound = matcher.end();
224+
lastCharSubstringFound = matcher.end();
225225
}
226226
} else {
227-
if (this.lastCharSubstingFound < 0) {
227+
if (this.lastCharSubstringFound < 0) {
228228
this.detectedException = new JBBPTokenizerException("Wrong format of whole string", 0);
229229
} else {
230-
final String restOfString = this.processingString.substring(this.lastCharSubstingFound);
230+
final String restOfString = this.processingString.substring(this.lastCharSubstringFound);
231231
if (restOfString.trim().length() != 0) {
232-
throw new JBBPTokenizerException("Can't recognize a part of script [" + restOfString + ']', this.lastCharSubstingFound);
232+
throw new JBBPTokenizerException("Can't recognize a part of script [" + restOfString + ']', this.lastCharSubstringFound);
233233
}
234234
}
235235
this.nextItem = null;

jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/varlen/JBBPExpressionEvaluator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public JBBPExpressionEvaluator(final String expression, final List<JBBPNamedFiel
272272
} else if (">>>".equals(operator)) {
273273
code = CODE_RSIGNSHIFT;
274274
} else {
275-
throw new Error("Detected unsupported operator, cotact developer [" + operator + ']');
275+
throw new Error("Detected unsupported operator, contact developer [" + operator + ']');
276276
}
277277

278278
if (theFirstInTheSubExpression) {

jbbp/src/main/java/com/igormaznitsa/jbbp/exceptions/JBBPFinderException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public JBBPFinderException(final String message, final String nameOrPath, final
4949
}
5050

5151
/**
52-
* Do not use the metod, it will be removed in future. It just presented for back compatibility.
52+
* Do not use the method, it will be removed in future. It just presented for back compatibility.
5353
*
5454
* @return the name or the path used for search, it can be null
5555
* @see #getNameOrPath()

jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public byte[] readByteArray(final int items) throws IOException {
216216
* @param items number of items to be read, if less than zero then read whole
217217
* stream till the end
218218
* @param byteOrder desired order of bytes
219-
* @return read byte items as a byte array, if byte order is LITTLE_ENDIAN then the result array will be revesed one
219+
* @return read byte items as a byte array, if byte order is LITTLE_ENDIAN then the result array will be reversed one
220220
* @throws IOException it will be thrown for any transport problem during the
221221
* operation
222222
* @see JBBPByteOrder#LITTLE_ENDIAN

0 commit comments

Comments
 (0)