Examples of toByteArray()


Examples of org.bson.io.OutputBuffer.toByteArray()

            Object id = dbo.get("_id");
            _checkKeys(dbo);
            DBEncoder encoder = factory.create();
            OutputBuffer buffer = new BasicOutputBuffer();
            encoder.writeObject(buffer, dbo);
            return buffer.toByteArray();
        }

        private void _checkKeys(DBObject o) {
            for (String s : o.keySet()) {
                validateKey(s);
View Full Code Here

Examples of org.bson.types.ObjectId.toByteArray()

    }

    @Test
    public void testBytes(){
        ObjectId a = new ObjectId();
        assertEquals( a , new ObjectId( a.toByteArray() ) );
       
        byte b[] = new byte[12];
        java.util.Random r = new java.util.Random( 17 );
        for ( int i=0; i<b.length; i++ )
            b[i] = (byte)(r.nextInt());
View Full Code Here

Examples of org.codehaus.activemq.util.FastOutputStream.toByteArray()

            FastOutputStream buffer = new FastOutputStream();
            DataOutputStream out = new DataOutputStream(buffer);
            out.writeLong(unwrapLong(previousKey));
            out.writeLong(unwrapLong(nextKey));
            out.writeUTF((String) value);
            return buffer.toByteArray();
        }

        public void fromBytes(byte[] data) throws IOException {
            DataInputStream in = new DataInputStream(new FastInputStream(data));
            this.previousKey = wrapLong(in.readLong());
View Full Code Here

Examples of org.codehaus.commons.compiler.jdk.ByteArrayJavaFileManager.ByteArrayJavaFileObject.toByteArray()

    if (!(classFileObject instanceof ByteArrayJavaFileObject))
      throw new UnsupportedOperationException("Only supports byte array based java file objects.");

    ByteArrayJavaFileObject bajfo = (ByteArrayJavaFileObject) classFileObject;
    return bajfo.toByteArray();

  }

  private class DiagListener implements DiagnosticListener<JavaFileObject> {
    @Override
View Full Code Here

Examples of org.codehaus.jackson.org.objectweb.asm.ClassWriter.toByteArray()

        if (!_objectGetters.isEmpty()) {
            _addObjectGetters(cw, _objectGetters, beanClass);
        }

        cw.visitEnd();
        byte[] byteCode = cw.toByteArray();
        return classLoader.loadAndResolve(srcName, byteCode);
    }

    /*
    /**********************************************************
 
View Full Code Here

Examples of org.codehaus.jackson.util.ByteArrayBuilder.toByteArray()

                // otherwise, our triple is now complete
                decodedData = (decodedData << 6) | bits;
                builder.appendThreeBytes(decodedData);
            }
        }
        return builder.toByteArray();
    }

    @Override
    public byte[] getBinaryValue() throws IOException
    {
View Full Code Here

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

      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
      PrintWriter writer = new PrintWriter(System.out);
      CheckClassAdapter cv = new CheckClassAdapter(cw);
      TraceClassVisitor tcv = new TraceClassVisitor(cv, writer );
      cr3.accept(tcv, ClassReader.EXPAND_FRAMES);
      byte[] newFile = cw.toByteArray();
      return newFile;
    }
   
    return ((ClassWriter)super.cv).toByteArray();
 
View Full Code Here

Examples of org.drools.asm.ClassWriter.toByteArray()

        this.buildToString( cw,
                            classDef );

        cw.visitEnd();

        return cw.toByteArray();
    }

    /**
     * Defines the class header for the given class definition
     *
 
View Full Code Here

Examples of org.eclipse.jgit.util.TemporaryBuffer.toByteArray()

  private static byte[] readFully(final InputStream is) throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    try {
      b.copy(is);
      b.close();
      return b.toByteArray();
    } finally {
      b.destroy();
    }
  }
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.ClassWriter.toByteArray()

        AnnotationVisitor av = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
        av.visit("namespace", namespace);

        cw.visitEnd();

        byte[] classBytes = cw.toByteArray();
        return generateClassFromBytes(qualifiedClassName, classBytes);
    }

    private Class generateWrapperForArrayClass(JavaClass arrayClass, TypeMappingInfo typeMappingInfo, Class xmlElementType, List<JavaClass> classesToProcess) {
        JavaClass componentClass = null;
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.