/** * Create an Erlang integer from a stream containing an integer encoded in * Erlang external format. * * @param buf * the stream containing the encoded value. * * @exception OtpErlangDecodeException * if the buffer does not contain a valid external * representation of an Erlang integer. * * @exception OtpErlangRangeException * if the value is too large to be represented as a char. */ public OtpErlangChar(final OtpInputStream buf) throws OtpErlangRangeException, OtpErlangDecodeException { super(buf); charValue(); } }
protected OtpErlangObject convertBasicTypeToErlang(Object obj) { if (obj instanceof byte[]) { return new OtpErlangBinary((byte[]) obj); } else if (obj instanceof Boolean) { return new OtpErlangBoolean((Boolean) obj); } else if (obj instanceof Byte) { return new OtpErlangByte((Byte) obj); } else if (obj instanceof Character) { return new OtpErlangChar((Character) obj); } else if (obj instanceof Double) { return new OtpErlangDouble((Double) obj); } else if (obj instanceof Float) { return new OtpErlangFloat((Float) obj); } else if (obj instanceof Integer) { return new OtpErlangInt((Integer) obj); } else if (obj instanceof Long) { return new OtpErlangLong((Long) obj); } else if (obj instanceof Short) { return new OtpErlangShort((Short) obj); } else if (obj instanceof String) { return new OtpErlangString((String) obj); } else { throw new ErlangConversionException( "Could not convert Java object of type [" + obj.getClass() + "] to an Erlang data type."); } }
return ((OtpErlangByte) erlangObject).byteValue(); } else if (erlangObject instanceof OtpErlangChar) { return ((OtpErlangChar) erlangObject).charValue(); } else if (erlangObject instanceof OtpErlangDouble) { return ((OtpErlangDouble) erlangObject).doubleValue();