Make FieldEditorHelper.java

This commit is contained in:
Astatin3
2024-09-13 15:48:14 -06:00
parent 85c90ac0ff
commit 5b4dc8c33b
9 changed files with 213 additions and 12 deletions
@@ -25,6 +25,13 @@ public class ByteBuilder {
public abstract byte[] build();
}
public static String blankStrNull(String str){
if(str.isEmpty() || str.isEmpty()){
return "null";
}
else return str;
}
private class boolType extends byteType {
public boolean val;
public byte getType(){return bool_id;}
@@ -87,6 +94,7 @@ public class ByteBuilder {
}
}
public ByteBuilder addString(String str) throws buildingException {
str = blankStrNull(str);
if(str.length() > 65536){throw new buildingException("String too long (greater than 65536)");}
stringType stringType = new stringType();