Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpInputStream


    private static OtpErlangPid getPid(ByteBuffer buffer, final int size)
    {
        try
        {
            return (new OtpInputStream(API.getBytes(buffer, size))).read_pid();
        }
        catch (OtpErlangDecodeException e)
        {
            e.printStackTrace(API.err);
            return null;
View Full Code Here


  runTest(new byte[] { (byte) 131, 116, 0, 0, 0, 1, 104, 1, 97, 3, 108,
    0, 0, 0, 1, 100, 0, 1, 114, 106 }, "#{{3} => [r]}", 4);

  try {
      // #{2 => [],a => 1}
      final OtpErlangMap map = new OtpErlangMap(new OtpInputStream(
      new byte[] { (byte) 131, 116, 0, 0, 0, 2, 97, 2, 106,
             100, 0, 1, 97, 97, 1 }));

      if (map.arity() != 2) {
    fail(5);
View Full Code Here

    }

    @SuppressWarnings("resource")
    private static void runTest(final byte[] in, final String out, final int err) {
  try {
      final OtpInputStream is = new OtpInputStream(in);

      final OtpErlangMap map = new OtpErlangMap(is);
      final String output = map.toString();
      if (!output.equals(out)) {
    fail("toString mismatch " + output + " <> " + out, err);
View Full Code Here

  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);
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.