String lspec = new String(lspecBuf);
  public static ATerm readTerm(InputStream inputStream, ATermFactory factory)    throws IOException  {    byte[] lspecBuf = new byte[LENSPEC];    inputStream.read(lspecBuf);    String lspec = new String(lspecBuf);    int bytesLeft = Integer.parseInt(lspec.substring(0, LENSPEC-1));    if (bytesLeft < MIN_MSG_SIZE) {      bytesLeft = MIN_MSG_SIZE;    }    bytesLeft -= LENSPEC;    byte[] data = new byte[bytesLeft];    inputStream.read(data);    String stringdata = new String(data);    //info("data read (" + bytesLeft + " bytes): '" + stringdata + "'");     return factory.parse(stringdata);  }