Examples of toByteArray()


Examples of aj.org.objectweb.asm.ClassWriter.toByteArray()

  public static byte[] addStackMaps(World world, byte[] data) {
    try {
      ClassReader cr = new ClassReader(data);
      ClassWriter cw = new AspectJConnectClassWriter(world);
      cr.accept(cw, 0);
      return cw.toByteArray();
    } catch (Throwable t) {
      System.err.println("AspectJ Internal Error: unable to add stackmap attributes. " + t.getMessage());
      AsmDetector.isAsmAround = false;
      return data;
    }
View Full Code Here

Examples of br.com.caelum.vraptor.asm.ClassWriter.toByteArray()

            + type.getClass().getName());
      }

    }
    cw.visitEnd();
    final byte[] bytes = cw.toByteArray();

    ClassLoader loader = new ClassLoader(this.getClass().getClassLoader()) {
      @Override
      public Class<?> loadClass(String name) throws ClassNotFoundException {
        if (name.equals(newTypeName)) {
View Full Code Here

Examples of br.net.woodstock.rockframework.io.ByteArrayWriter.toByteArray()

        transformer.transform(new DOMSource(document), domResult);

        ByteArrayWriter writer = new ByteArrayWriter();
        XmlWriter.getInstance().write(outputDocument, writer, Charset.defaultCharset());

        currentData = writer.toByteArray();
      }
      return currentData;
    } catch (Exception e) {
      throw new SignerException(e);
    }
View Full Code Here

Examples of by.stub.repackaged.org.apache.commons.io.output.ByteArrayOutputStream.toByteArray()

   private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;

   public static byte[] toByteArray(InputStream input) throws IOException {
      ByteArrayOutputStream output = new ByteArrayOutputStream();
      copy(input, output);
      return output.toByteArray();
   }

   /**
    * Copy bytes from an <code>InputStream</code> to an
    * <code>OutputStream</code>.
 
View Full Code Here

Examples of ch.ethz.inf.vs.scandium.util.DatagramWriter.toByteArray()

    for (ECPointFormat format : ecPointFormatList) {
      writer.write(format.getId(), POINT_FORMAT_BITS);
    }

    return writer.toByteArray();
  }

  public static HelloExtension fromByteArray(byte[] byteArray) {
    DatagramReader reader = new DatagramReader(byteArray);
View Full Code Here

Examples of co.paralleluniverse.galaxy.core.Message.BACKUP_PACKET.toByteArray()

        final BACKUP_PACKET m1 = Message.BACKUP_PACKET(rand.nextLong(), Arrays.asList(
                Message.BACKUP(rand.nextLong(), rand.nextLong(), randomBuffer(100)),
                Message.BACKUP(rand.nextLong(), rand.nextLong(), randomBuffer(45)),
                Message.BACKUP(rand.nextLong(), rand.nextLong(), randomBuffer(70))));

        byte[] array = m1.toByteArray();
        final BACKUP_PACKET m2 = (BACKUP_PACKET) Message.fromByteArray(array);

        assertThat(m2.getId(), equalTo(m1.getId()));
        assertThat(m2.getBackups().size(), equalTo(m1.getBackups().size()));
        for (int i = 0; i < m1.getBackups().size(); i++)
View Full Code Here

Examples of codechicken.lib.asm.CC_ClassWriter.toByteArray()

            return bytes;

        ClassNode cnode = ASMHelper.createClassNode(bytes, ClassReader.EXPAND_FRAMES);
        ClassWriter cw = new CC_ClassWriter(0, true);
        run.remap(cnode, cw);
        return cw.toByteArray();
    }

    private byte[] injectCallback(byte[] bytes) {
        ClassNode cnode = ASMHelper.createClassNode(bytes);
        MethodNode mnode = ASMHelper.findMethod(new ObfMapping(cnode.name, "<clinit>", "()V"), cnode);
View Full Code Here

Examples of com.adito.security.pki.SimpleASNWriter.toByteArray()

            SimpleASNWriter asnEncoded = new SimpleASNWriter();
            asnEncoded.writeByte(0x30);
            asnEncoded.writeData(asn.toByteArray());

            byte[] encoded = asnEncoded.toByteArray();

            if (log.isDebugEnabled()) {
                log.debug("Verifying host key signature");
                log.debug("Signature length is " +
                    String.valueOf(signature.length));
View Full Code Here

Examples of com.akdeniz.googleplaycrawler.GooglePlay.AndroidCheckinRequest.toByteArray()

  AndroidCheckinRequest build = checkInbuilder.setId(new BigInteger(this.getAndroidID(), 16).longValue())
    .setSecurityToken(new BigInteger(getSecurityToken(), 16).longValue()).addAccountCookie("[" + getEmail() + "]")
    .addAccountCookie(c2dmAuth).build();
  // this is the second checkin to match credentials with android-id
  return postCheckin(build.toByteArray());
    }
   
    /**
     * Logins AC2DM server and returns authentication string.
     *
 
View Full Code Here

Examples of com.akdeniz.googleplaycrawler.GooglePlay.UploadDeviceConfigRequest.toByteArray()

     */
    public UploadDeviceConfigResponse uploadDeviceConfig() throws Exception {

  UploadDeviceConfigRequest request = UploadDeviceConfigRequest.newBuilder()
    .setDeviceConfiguration(Utils.getDeviceConfigurationProto()).build();
  ResponseWrapper responseWrapper = executePOSTRequest(UPLOADDEVICECONFIG_URL, request.toByteArray(),
    "application/x-protobuf");
  return responseWrapper.getPayload().getUploadDeviceConfigResponse();
    }
   
    /**
 
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.