Package erjang.m.java

Examples of erjang.m.java.JavaObject


    EAtom f = fun.testAtom();
    if (f == null) {
      throw ERT.badarg(mod, fun, ESmall.make(arity));
    }

    JavaObject jo;
    if ((jo = mod.testJavaObject()) != null) {
      return jo.resolve_fun(f, arity);
    }
   
    EAtom m = mod.testAtom();
   
    if (m == null)
View Full Code Here


  @BIF
  public static EObject apply(EProc proc, EObject one, EObject two, EObject three) throws Pausable {
    EAtom mod = one.testAtom();
    ETuple t = one.testTuple();
    JavaObject jo = one.testJavaObject();
   
    EAtom fun = two.testAtom();
    ESeq  args = three.testSeq();
   
    if ((mod==null && t == null && jo == null)||fun==null||args==null) throw ERT.badarg(one, two, three);
View Full Code Here

       md = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
      throw new NotImplemented();
    }
   
    return new JavaObject(self, md);
  }
View Full Code Here

    List<ByteBuffer> buf = new ArrayList<ByteBuffer>();
    if (!iolist_arg.collectIOList(buf)) {
      throw ERT.badarg(context, iolist_arg);
    }
   
    JavaObject jo;
    if ((jo = context.testJavaObject()) != null && (jo.realObject() instanceof MessageDigest)) {
      MessageDigest md = (MessageDigest) jo.realObject();
     
      for (int i = 0; i < buf.size(); i++) {
        md.update(buf.get(i));
     
     
      return new JavaObject(self, md);
    }
   
    throw ERT.badarg(context, iolist_arg);
  }
View Full Code Here

 
 
  @BIF
  public static EObject md5_final(EProc self, EObject context)
  {
    JavaObject jo;
    if ((jo = context.testJavaObject()) != null && (jo.realObject() instanceof MessageDigest)) {
      MessageDigest md = (MessageDigest) jo.realObject();
     
      byte[] res = md.digest();
      return EBinary.make(res, 0, res.length, 0);
    }
   
View Full Code Here

TOP

Related Classes of erjang.m.java.JavaObject

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.