Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangBinary.binaryValue()


        final OtpErlangObject logEvent = t.elementAt(3);
        String ss = "";
        if (t.arity() == 5) {
            final OtpErlangTuple backtrace_0 = (OtpErlangTuple) t.elementAt(4);
            final OtpErlangBinary backtrace = (OtpErlangBinary) backtrace_0.elementAt(1);
            ss = new String(backtrace.binaryValue());
        }
        try {
            ErlLogger.getInstance().erlangLog(module.atomValue() + ".erl",
                    line.uIntValue(), level.atomValue().toUpperCase(), "%s %s",
                    logEvent.toString(), ss);
View Full Code Here


        List<ErlToken> toks = null;
        if (Util.isOk(t1)) {
            if (t1.elementAt(1) instanceof OtpErlangBinary) {
                final OtpErlangBinary b = (OtpErlangBinary) t1.elementAt(1);
                final byte[] bytes = b.binaryValue();
                toks = new ArrayList<ErlToken>(bytes.length / 10);
                for (int i = 0; i < bytes.length; i += 10) {
                    final ErlToken tk = new ErlToken(bytes, i, offset);
                    toks.add(tk);
                }
View Full Code Here

        } else if (value instanceof OtpErlangList) {
            final OtpErlangList l = (OtpErlangList) value;
            return l.elementAt(index);
        } else if (value instanceof OtpErlangBinary) {
            final OtpErlangBinary bs = (OtpErlangBinary) value;
            int j = bs.binaryValue()[index];
            if (j < 0) {
                j += 256;
            }
            return new OtpErlangLong(j);
        } else if (list != null) {
View Full Code Here

      assertEquals(testArg[i], testResult[i]);
    }
    OtpErlangBinary received = (OtpErlangBinary) mboxListener.getMsg();
    assertEquals(testArg.length, received.size());
    for (int i = 0; i < testArg.length; i++) {
      assertEquals(testArg[i], received.binaryValue()[i]);
    }
  }

  /**
   * Tests passing lists
View Full Code Here

                return null;
            }
        } else if (o instanceof OtpErlangBinary) {
            final OtpErlangBinary b = (OtpErlangBinary) o;
            String result;
            result = decode(b.binaryValue(), Charsets.UTF_8);
            if (result == null) {
                result = decode(b.binaryValue(), Charsets.ISO_8859_1);
            }
            if (result == null) {
                ErlLogger.error("bad binary value in stringValue" + " (can't decode): "
View Full Code Here

        } else if (o instanceof OtpErlangBinary) {
            final OtpErlangBinary b = (OtpErlangBinary) o;
            String result;
            result = decode(b.binaryValue(), Charsets.UTF_8);
            if (result == null) {
                result = decode(b.binaryValue(), Charsets.ISO_8859_1);
            }
            if (result == null) {
                ErlLogger.error("bad binary value in stringValue" + " (can't decode): "
                        + o);
            }
View Full Code Here

            if (sb.length() < maxLength) {
                ioListToStringBuilder(l.getLastTail(), sb, maxLength);
            }
        } else if (o instanceof OtpErlangBinary) {
            final OtpErlangBinary b = (OtpErlangBinary) o;
            String s = decode(b.binaryValue(), Charsets.UTF_8);
            if (s == null) {
                s = new String(b.binaryValue(), Charsets.ISO_8859_1);
            }
            sb.append(s);
        } else if (o != null) {
View Full Code Here

            }
        } else if (o instanceof OtpErlangBinary) {
            final OtpErlangBinary b = (OtpErlangBinary) o;
            String s = decode(b.binaryValue(), Charsets.UTF_8);
            if (s == null) {
                s = new String(b.binaryValue(), Charsets.ISO_8859_1);
            }
            sb.append(s);
        } else if (o != null) {
            sb.append(o.toString());
        }
View Full Code Here

      assertEquals(testArg[i], testResult[i]);
    }
    OtpErlangBinary received = (OtpErlangBinary) mboxListener.getMsg();
    assertEquals(testArg.length, received.size());
    for (int i = 0; i < testArg.length; i++) {
      assertEquals(testArg[i], received.binaryValue()[i]);
    }
  }

  /**
   * Tests passing lists
View Full Code Here

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

TOP
Copyright © 2018 www.massapi.com. 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.