@Test
public void decode () throws Exception {

  val bytes = Bytes.resizableArray()
      .write1B(STRING.getCode())
      .write2B("popa".length())
      .writeNB("popa", ISO_8859_1)
      .arrayCopy();
  try (val input = new OtpInputStream(bytes)) {
    ErlangString string = ErlangTerm.newInstance(wrappedBuffer(bytes));
    assertThat(string.asText())
        .isEqualTo(input.read_string());
  }
}