Class OtpErlangBinary

  • All Implemented Interfaces:, java.lang.Cloneable

    public class OtpErlangBinary
    extends OtpErlangBitstr
    Provides a Java representation of Erlang binaries. Anything that can be represented as a sequence of bytes can be made into an Erlang binary.
    See Also:
    Serialized Form
    • Constructor Detail

      • OtpErlangBinary

        public OtpErlangBinary​(byte[] bin)
        Create a binary from a byte array
        bin - the array of bytes from which to create the binary.
      • OtpErlangBinary

        public OtpErlangBinary​(OtpInputStream buf)
                        throws OtpErlangDecodeException
        Create a binary from a stream containing a binary encoded in Erlang external format.
        buf - the stream containing the encoded binary.
        OtpErlangDecodeException - if the buffer does not contain a valid external representation of an Erlang binary.
      • OtpErlangBinary

        public OtpErlangBinary​(java.lang.Object o)
        Create a binary from an arbitrary Java Object. The object must implement or
        o - the object to serialize and create this binary from.
    • Method Detail

      • encode

        public void encode​(OtpOutputStream buf)
        Convert this binary to the equivalent Erlang external representation.
        encode in class OtpErlangBitstr
        buf - an output stream to which the encoded binary should be written.