### Question:
BinaryTypeNode extends VariantTypeNode { @Override public String getValue() { return value; } BinaryTypeNode(BinaryReader binaryReader, ChunkHeader chunkHeader, BxmlNode parent, int length); @Override String getValue();  }### Answer:
@Test public void testLength() throws IOException { String val = "Test String"; BinaryReader binaryReader = testBinaryReaderBuilder.putDWord(val.length()).putString(val).build(); assertEquals(Base64.getEncoder().encodeToString(val.getBytes(Charsets.US_ASCII)), new BinaryTypeNode(binaryReader, chunkHeader, parent, -1).getValue()); }
@Test(expected = IOException.class) public void testInvalidStringLength() throws IOException { String val = "Test String"; BinaryReader binaryReader = testBinaryReaderBuilder.putDWord(UnsignedInteger.fromIntBits(Integer.MAX_VALUE + 1)).putString(val).build(); assertEquals(Base64.getEncoder().encodeToString(val.getBytes(Charsets.US_ASCII)), new BinaryTypeNode(binaryReader, chunkHeader, parent, -1).getValue()); }
@Test public void testNoLength() throws IOException { String val = "Test String"; BinaryReader binaryReader = testBinaryReaderBuilder.putString(val).build(); assertEquals(Base64.getEncoder().encodeToString(val.getBytes(Charsets.US_ASCII)), new BinaryTypeNode(binaryReader, chunkHeader, parent, val.length()).getValue()); }