Examples of toByteArray()


Examples of org.eclipse.sisu.space.asm.ClassWriter.toByteArray()

            mv.visitInsn( Opcodes.RETURN );
            mv.visitMaxs( 1, 1 );
            mv.visitEnd();
            cw.visitEnd();

            final byte[] buf = cw.toByteArray();

            return defineClass( name, buf, 0, buf.length );
        }
    }
}
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.reflect.AbstractMethodsImplementorVisitor.toByteArray()

    if (classBytes != null) {
      if (m_nonAbstractClasses.contains(className)) {
        org.objectweb.asm.ClassReader classReader = new org.objectweb.asm.ClassReader(classBytes);
        AbstractMethodsImplementorVisitor rewriter = new AbstractMethodsImplementorVisitor(className);
        classReader.accept(rewriter, 0);
        classBytes = rewriter.toByteArray();
      }
      // force "private static final boolean isDesignTime()" return "true"
      if (!className.startsWith("com.google.")
          && !className.startsWith("com.extjs.")
          && !className.startsWith("com.smartgwt.")) {
View Full Code Here

Examples of org.enclojure.ide.asm.ClassWriter.toByteArray()

            cr.accept(co, ClassReader.SKIP_DEBUG);

            Set constants = new TreeSet(new ConstantComparator());
            constants.addAll(cp.values());

            cr = new ClassReader(cw.toByteArray());
            cw = new ClassWriter(0);
            Iterator i = constants.iterator();
            while (i.hasNext()) {
                Constant c = (Constant) i.next();
                c.write(cw);
View Full Code Here

Examples of org.exist.storage.io.VariableByteOutputStream.toByteArray()

      try {
        proxy.getNodeId().write(buf);
      } catch (IOException e) {
        throw new RuntimeException("unable to serialize node's id to compute hashCode", e);
      }
      return proxy.getDocument().getURI().hashCode() ^ Arrays.hashCode(buf.toByteArray());
    } else {
      return item.hashCode();
    }
  }
 
View Full Code Here

Examples of org.exoplatform.xml.object.XMLCollection.toByteArray()

      List list = new ArrayList();
      list.add("test.....................");
      list.add(new Date());
      XMLCollection xmllist = new XMLCollection(list);
      os = new FileOutputStream(projectdir + "/target/list.xml");
      os.write(xmllist.toByteArray("UTF-8"));
      os.close();
   }

   static public class TestObject
   {
View Full Code Here

Examples of org.exoplatform.xml.object.XMLObject.toByteArray()

   public void testConvert() throws Exception
   {
      String projectdir = System.getProperty("basedir");
      XMLObject xmlobj = new XMLObject(new TestObject());
      String xml1 = new String(xmlobj.toByteArray("UTF-8"));
      FileOutputStream os = new FileOutputStream(projectdir + "/target/test-object-1.xml");
      os.write(xml1.getBytes());
      os.close();

      File file = new File(projectdir + "/target/test-object-1.xml");
View Full Code Here

Examples of org.fudgemsg.FudgeContext.toByteArray()

    ManageableExchange exchange = new ManageableExchange();
    exchange.setUniqueId(UniqueId.of("DbExg", "101", "0"));
    exchange.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("E", "F")));
    exchange.setName("TestExchange101");
    exchange.setTimeZone(ZoneId.of("Europe/London"));
    byte[] bytes = fudgeContext.toByteArray(fudgeContext.toFudgeMsg(exchange).getMessage());
    template.update("INSERT INTO exg_exchange VALUES (?,?,?,?,?, ?,?,?,?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "TestExchange101", "Europe/London", new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    exchange.setUniqueId(UniqueId.of("DbExg", "102", "0"));
    exchange.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("G", "H")));
View Full Code Here

Examples of org.fusesource.hawtbuf.Buffer.toByteArray()

            if (isReturnOldExchange()) {
                rc = levelDBFile.getDb().get(lDbKey);
            }

            LOG.trace("Adding key index {} for repository {}", key, repositoryName);
            levelDBFile.getDb().put(lDbKey, exchangeBuffer.toByteArray(), levelDBFile.getWriteOptions());
            LOG.trace("Added key index {}", key);

            if (rc == null) {
                return null;
            }
View Full Code Here

Examples of org.fusesource.hawtbuf.ByteArrayOutputStream.toByteArray()

    }

    public static byte[] readBytes(InputStream in) throws IOException {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      copyInputStream(in, baos);
      return baos.toByteArray();
    }

    public static void writeText(File path, String text) throws IOException {
        writeText(path, text, "UTF-8");
    }
View Full Code Here

Examples of org.geolatte.geom.ByteBuffer.toByteArray()

        WkbEncoder encoder = Wkb.newEncoder(Wkb.Dialect.POSTGIS_EWKB_1);
        ByteBuffer buffer = encoder.encode(value, byteOrder);
        int srid = value.getSRID();

        // prepend srid into first 4 bytes
        byte[] wkb = buffer.toByteArray();
        byte[] bytes = new byte[wkb.length + 4];
        bytes[3] = (byte) ((srid >> 24) & 0xFF);
        bytes[2] = (byte) ((srid >> 16) & 0xFF);
        bytes[1] = (byte) ((srid >> 8) & 0xFF);
        bytes[0] = (byte) (srid & 0xFF);
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.