final OtpErlangObject t) throws OtpErlangException {
hash_set.add(i);
if (t instanceof OtpErlangAtom) {
final String atomValue = ((OtpErlangAtom) t).atomValue();
if (atomValue.equals("binary") && i instanceof OtpErlangBinary) {
final OtpErlangBinary b = (OtpErlangBinary) i;
@SuppressWarnings("resource")
final OtpInputStream bis = new OtpInputStream(b.binaryValue(),
0);
final OtpErlangObject o = bis.read_any();
return o;
} else if (atomValue.equals("compress")) {
@SuppressWarnings("resource")
final OtpOutputStream oos = new OtpOutputStream();
oos.write1(OtpExternal.versionTag);
oos.write_compressed(i);
final OtpErlangBinary o =
new OtpErlangBinary(oos.toByteArray());
return o;
} else if (atomValue.equals("bigint")
&& i instanceof OtpErlangLong) {
final OtpErlangLong l = (OtpErlangLong) i;
final int w = l.signum() * l.bitLength();
final OtpErlangLong x = new OtpErlangLong(l.longValue());
final java.math.BigInteger b = l.bigIntegerValue();
System.out.println("long: " + l + ": " + w + ": " + b.signum()
* b.bitLength() + ": " + x + ": " + l.isLong() + ": "
+ l.isULong());
return new OtpErlangTuple(new OtpErlangObject[] { l,
new OtpErlangInt(w), x,
new OtpErlangInt(l.isLong() ? 1 : 0),
new OtpErlangInt(l.isULong() ? 1 : 0) });
} else if (atomValue.equals("tail")
&& i instanceof OtpErlangList) {
final OtpErlangObject o = ((OtpErlangList) i).getTail();
if (o == null) {
return new OtpErlangAtom("null");
}
return o;
} else if (atomValue.equals("tail3")
&& i instanceof OtpErlangList) {
final OtpErlangObject o = ((OtpErlangList) i).getNthTail(3);
if (o == null) {
return new OtpErlangAtom("null");
}
return o;
} else if (atomValue.equals("strcat")
&& i instanceof OtpErlangList) {
final java.lang.StringBuffer b = new java.lang.StringBuffer();
final OtpErlangList l = (OtpErlangList) i;
for (final OtpErlangObject j : l) {
final OtpErlangString k = (OtpErlangString) j;
b.append(k.stringValue());
}
final OtpErlangObject o = new OtpErlangString(b.toString());
return o;
} else if (atomValue.equals("sub3atom")
&& i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
final OtpErlangAtom o = new OtpErlangAtom(s.stringValue()
.substring(3));
return o;
} else if (atomValue.equals("codepointBug")
&& i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
final String ss = s.stringValue().substring(3, 6);
@SuppressWarnings("unused")
final int[] cps = OtpErlangString.stringToCodePoints(ss);
return s;
} else if (atomValue.equals("utf8")) {
if (i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
byte[] bytes;
try {
bytes = s.stringValue().getBytes("UTF-8");
} catch (final UnsupportedEncodingException e) {
bytes = new byte[] { 'e', 'r', 'r', 'o', 'r' };
}
final OtpErlangBinary b = new OtpErlangBinary(bytes);
return b;
}
} else if(atomValue.equals("to_string_neg_int_list")) {
OtpErlangString oes = null;
if (i instanceof OtpErlangString) {