Package objot.util

Examples of objot.util.Bytes


  public int getParamN()
  {
    if (paramN < 0)
    {
      Bytes desc = cons.getUtf(descCi);
      paramN = getParamN(desc);
      paramLocalN = getParamLocalN(desc);
      returnType = getReturnTypeChar(desc);
    }
    return paramN;
View Full Code Here


    int verbose = 1;
    for (String p: ps)
      if (p.startsWith("-v"))
        verbose = Integer.parseInt(p.substring(2));
      else
        new Bytecode(new Bytes(new FileInputStream(p), true)).printTo(System.out, 0,
          0, verbose);
  }
View Full Code Here

    if ((Integer)_.uniqueResult() == 0)
      throw err("You must be his/her friend");
    c.datime = new Date();
    while (smiley != null && smiley.available() > 0)
    {
      final Bytes b = new Bytes(smiley, false);
      final ByteArrayInputStream in = new ByteArrayInputStream(b.bytes, b.beginBi,
        b.byteN());
      Smiley s = new Smiley();
      s.in = c.in;
      s.image = new Blob()
      {
        public long length()
        {
          return b.byteN();
        }

        public void truncate(long pos)
        {
          throw new UnsupportedOperationException();
View Full Code Here

        utf[ui++] = (byte)(0xE0 | (c >>> 12) & 0x0F);
        utf[ui++] = (byte)(0x80 | (c >>> 6) & 0x3F);
        utf[ui++] = (byte)(0x80 | c & 0x3F);
      }
    }
    return new Bytes(utf);
  }
View Full Code Here

  /** @see Class2#pathName(Class) */
  public static Bytes classDesc2Name(Bytes descUtf, int begin, int end1)
  {
    if (descUtf.readS1(begin) != 'L' || descUtf.readS1(end1 - 1) != ';')
      throw new IllegalArgumentException("only declaring class supported");
    return new Bytes(descUtf, begin + 1, end1 - begin - 2);
  }
View Full Code Here

      in.total = len;
      if (in.next())
      {
        if (in.name().length() > 0)
          hq.getSession().setAttribute(up = PROGRESS.concat(in.name()), in);
        Bytes s = new Bytes(in, false);
        len = s.byteN();
        q = String2.utf(s.bytes, s.beginBi, len);
        in.next();
      }
      if (inf.reqUpload)
        extraQs = new Object[] { in };
    }
    else if (len > 0)
    {
      InputStream in = hq.getInputStream();
      byte[] s = new byte[len];
      for (int begin = 0, done; begin < len; begin += done)
        if ((done = in.read(s, begin, len - begin)) < 0)
          throw new EOFException();
      q = String2.utf(s);
    }
    else if (hq.getQueryString() != null)
      q = URLDecoder.decode(hq.getQueryString(), "UTF-8").toCharArray();

    Container c = con.create();
    c.set(HttpServletRequest.class, hq);
    c.set(HttpServletResponse.class, hp);
    c.set(HttpSession.class, hq.getSession());
    c.set(String.class, "application/octet-stream");
    Object p;
    try
    {
      p = handler.handle(c, inf, q, 0, q.length, extraQs);
    }
    catch (RuntimeException e)
    {
      throw e;
    }
    catch (IOException e)
    {
      throw e;
    }
    catch (Exception e)
    {
      throw new ServletException(e);
    }
    finally
    {
      if ( !String2.empty(up))
        hq.getSession().removeAttribute(up);
    }
    if (p == null)
      throw null;
    if (p instanceof CharSequence)
    {
      if (up != null)
      {
        hp.setContentType("text/html; charset=UTF-8");
        CharSequence r = (CharSequence)p;
        StringBuilder s = new StringBuilder();
        s.append("<pre id=objot>");
        for (int i = 0; i < r.length(); i++)
          if (r.charAt(i) == '&')
            s.append("&amp;");
          else if (r.charAt(i) == '<')
            s.append("&lt;");
          else
            s.append(r.charAt(i));
        p = s.append("</pre>").toString();
      }
      byte[] bs = String2.utf((CharSequence)p);
      hp.setContentLength(bs.length);
      hp.getOutputStream().write(bs);
    }
View Full Code Here

    if (ao.getInsS1(ad) != INVOKESTATIC)
      return false;
    int ci = ao.getInsU2(ad + 1);
    if ( !cons.equalsUtf(cons.getCprocClass(ci), Weaver.TARGET_NAME))
      return false;
    Bytes name = cons.getUtf(cons.getCprocName(ci));
    if (Targ.data.utf.equals(name))
      targData(pi, datasCi);
    else if (Targ.name.utf.equals(name))
      targName();
    else if (Targ.descript.utf.equals(name))
View Full Code Here

  private void targTarget()
  {
    if (targetStrCi <= 0)
    {
      Bytes b = new Bytes(targetName);
      int n = wp.getNameCi();
      int d = wp.getDescCi();
      b.addByteN(cons.getUtfByteN(n) + cons.getUtfByteN(d));
      cons.getUtfTo(n, b, targetName.byteN());
      cons.getUtfTo(d, b, targetName.byteN() + cons.getUtfByteN(n));
      targetStrCi = cons.addString(cons.addUtf(b));
    }
    ws.insU2(LDCW, targetStrCi);
View Full Code Here

  }

  private void targInvoke()
  {
    ws.ins0(ALOAD0);
    Bytes desc = cons.getUtf(wp.getDescCi());
    for (int i = 1, b = desc.beginBi + 1; desc.bytes[b] != ')';)
    {
      ws.insU1wU2(Opcode.getLoadOp((char)desc.bytes[b]), i);
      i += Opcode.getLocalStackN((char)desc.bytes[b]);
      b += Bytecode.typeDescByteN(desc, b - desc.beginBi);
View Full Code Here

    if (ao.getInsS1(ad) != INVOKESPECIAL)
      return false;
    int ci = ao.getInsU2(ad + 1);
    if ( !cons.equalsUtf(cons.getCprocClass(ci), Weaver.ASPECT_NAME))
      return false;
    Bytes desc = cons.getUtf(wp.getDescCi());
    for (int i = 1, b = desc.beginBi + 1; desc.bytes[b] != ')';)
    {
      ws.insU1wU2(Opcode.getLoadOp((char)desc.bytes[b]), i);
      i += Opcode.getLocalStackN((char)desc.bytes[b]);
      b += Bytecode.typeDescByteN(desc, b - desc.beginBi);
View Full Code Here

TOP

Related Classes of objot.util.Bytes

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.