| 6 | |
| 7 | |
| 8 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected