BEParser implements AutoCloseable { public BEString readString() { return readObject(BEType.STRING, BEStringBuilder.class); } BEParser(URL url);  BEParser(InputStream in);  BEParser(byte[] bs); BEType readType(); BEString readString(); BEInteger readInteger(); BEList readList(); BEMap readMap(); @Override void close();  }
@Test public void testParse_String_LengthStartsWithZero() { BEString string = new BEParser("0:".getBytes()).readString(); assertNotNull(string); assertEquals(0, string.getValue().length); }
@Test(expected = Exception.class) public void testParse_String_Exception_InsufficientContent() { new BEParser("7:abcdef".getBytes()).readString(); }