Examples of toByteArray()


Examples of org.apache.lucene.util.UnsafeByteArrayOutputStream.toByteArray()

    for (int i = 0; i < 100; i++) {
      ubaos.write((byte) i);
    }

    byte[] result = ubaos.toByteArray();

    assertEquals(length, ubaos.length());

    for (int j = 0; j < length; ++j) {
      assertEquals(result[j], j);
View Full Code Here

Examples of org.apache.niolex.commons.seri.Proto.Person.toByteArray()

    int i = 2345;
    Person p = Person.newBuilder().setEmail("kjdfjkdf" + i + "@xxx.com").setId(45 + i)
        .setName("Niolex [" + i + "]")
        .addPhone(PhoneNumber.newBuilder().setNumber("123122311" + i).setType(PhoneType.MOBILE).build())
        .build();
    byte[] ret = p.toByteArray();
    Set<String> set = new HashSet<String>();
    parseMulti(ret, new Type[] {set.getClass().getGenericSuperclass(), Person.class});
  }

  /**
 
View Full Code Here

Examples of org.apache.openejb.asm.ClassWriter.toByteArray()

        FieldAdderClassVisitor visitor = new FieldAdderClassVisitor(classWriter);

        ClassReader classReader = new ClassReader(origBytes);
        classReader.accept(visitor, 0);

        byte[] newBytes = classWriter.toByteArray();
        return newBytes;
    }

    public static class FieldAdderClassVisitor extends ClassAdapter {
        public FieldAdderClassVisitor(ClassVisitor classVisitor) {
View Full Code Here

Examples of org.apache.pdfbox.contentstream.operator.Operator.toByteArray()

                    currentByte = pdfSource.read();
                }
                // the EI operator isn't unread, as it won't be processed anyway
                retval = Operator.getOperator("ID");
                // save the image data to the operator, so that it can be accessed later
                ((Operator)retval).setImageData( imageData.toByteArray() );
                break;
            }
            case ']':
            {
                // some ']' around without its previous '['
View Full Code Here

Examples of org.apache.pdfbox.pdfwriter.COSFilterInputStream.toByteArray()

        COSFilterInputStream fis=null;

        try
        {
            fis = new COSFilterInputStream(pdfFile,getByteRange());
            return fis.toByteArray();
        }
        finally
        {
            if (fis != null)
            {
View Full Code Here

Examples of org.apache.pdfbox.util.PDFOperator.toByteArray()

                    count++;
                }
                pdfSource.unread( 'I' ); //unread the EI operator
                pdfSource.unread( 'E' );
                retval = PDFOperator.getOperator( "ID" );
                ((PDFOperator)retval).setImageData( imageData.toByteArray() );
                break;
            }
            case ']':
            {
                // some ']' around without its previous '['
View Full Code Here

Examples of org.apache.poi.hwpf.model.io.HWPFOutputStream.toByteArray()

    // write out the FileInformationBlock.
    //_fib.serialize(mainBuf, 0);
    _fib.writeTo(mainBuf, tableStream);

    byte[] tableBuf = tableStream.toByteArray();
    if (tableBuf.length < 4096)
    {
      byte[] tempBuf = new byte[4096];
      System.arraycopy(tableBuf, 0, tempBuf, 0, tableBuf.length);
      tableBuf = tempBuf;
View Full Code Here

Examples of org.apache.synapse.util.FixedByteArrayOutputStream.toByteArray()

                ByteArrayOutputStream baosForSource = new FixedByteArrayOutputStream(BYTE_ARRAY_SIZE);
                XMLStreamWriter xsWriterForSource = XMLOutputFactory.newInstance().
                    createXMLStreamWriter(baosForSource);

                sourceNode.serialize(xsWriterForSource);
                isForSource = new ByteArrayInputStream(baosForSource.toByteArray());
                transformSrc = new StreamSource(isForSource);
                transformTgt = new StreamResult(baosForTarget);

            } catch (XMLStreamException e) {
                handleException("Error creating a StreamResult for the transformation", e, synCtx);
View Full Code Here

Examples of org.apache.tapestry5.internal.plastic.asm.ClassWriter.toByteArray()

    {
        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);

        classNode.accept(writer);

        return writer.toByteArray();
    }

    public AnnotationAccess createAnnotationAccess(String className)
    {
        try
View Full Code Here

Examples of org.apache.tez.mapreduce.protos.MRRuntimeProtos.MRInputUserPayloadProto.toByteArray()

      this.conf.set("mapred.input.format.class", TezGroupedSplitsInputFormat.class.getName());
      MRInputUserPayloadProto updatedPayload = MRInputUserPayloadProto
          .newBuilder(protoPayload)
          .setConfigurationBytes(MRHelpers.createByteStringFromConf(conf))
          .build();
      inputDescriptor.setUserPayload(updatedPayload.toByteArray());
    } catch (IOException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
    boolean dataInformationEventSeen = false;
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.