MCPcopy Create free account
hub / github.com/Hiro420/NikkeTools / LBooleanType

Class LBooleanType

UnLuac/src/unluac/parse/LBooleanType.java:8–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8public class LBooleanType extends BObjectType<LBoolean> {
9
10 @Override
11 public LBoolean parse(ByteBuffer buffer, BHeader header) {
12 int value = buffer.get();
13 if((value & 0xFFFFFFFE) != 0) {
14 throw new IllegalStateException();
15 } else {
16 LBoolean bool = value == 0 ? LBoolean.LFALSE : LBoolean.LTRUE;
17 if(header.debug) {
18 System.out.println("-- parsed <boolean> " + bool);
19 }
20 return bool;
21 }
22 }
23
24 @Override
25 public void write(OutputStream out, BHeader header, LBoolean object) throws IOException {
26 int value = object.value() ? 1 : 0;
27 out.write(value);
28 }
29
30}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected