Examples of toByteArray()


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

    // Re-serialize the splits after grouping.
    int count = 0;
    for (InputSplit inputSplit : finalSplits) {
      MRSplitProto serializedSplit = MRHelpers.createSplitProto(inputSplit);
      RootInputDataInformationEvent diEvent = new RootInputDataInformationEvent(
          count, serializedSplit.toByteArray());
      diEvent.setTargetIndex(count);
      count++;
      taskEvents.add(diEvent);
    }
View Full Code Here

Examples of org.apache.tez.runtime.library.shuffle.impl.ShuffleUserPayloads.DataMovementEventPayloadProto.toByteArray()

    payloadBuilder.setHost(host);
    payloadBuilder.setPort(shufflePort);
    payloadBuilder.setPathComponent(outputContext.getUniqueIdentifier());
    payloadBuilder.setRunDuration((int) ((endTime - startTime) / 1000));
    DataMovementEventPayloadProto payloadProto = payloadBuilder.build();
    byte[] payloadBytes = payloadProto.toByteArray();

    long outputSize = outputContext.getCounters()
        .findCounter(TaskCounter.MAP_OUTPUT_BYTES).getValue();
    VertexManagerEventPayloadProto.Builder vmBuilder = VertexManagerEventPayloadProto
        .newBuilder();
View Full Code Here

Examples of org.apache.wicket.util.io.ByteArrayOutputStream.toByteArray()

  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    for (IResourceStream curStream : resources)
      IOUtils.copy(curStream.getInputStream(), output);

    byte[] bytes = output.toByteArray();

    if (getCompressor() != null)
    {
      String nonCompressed = new String(bytes, "UTF-8");
      bytes = getCompressor().compress(nonCompressed).getBytes("UTF-8");
View Full Code Here

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

        BufferedInputStream bis = new BufferedInputStream(bais);

        ClassWriter cw = new BCClassWriter(ClassWriter.COMPUTE_FRAMES, bc.getClassLoader());
        ClassReader cr = new ClassReader(bis);
        cr.accept(cw, 0);
        return cw.toByteArray();
    }

    private static class BCClassWriter extends ClassWriter {
        private final ClassLoader _loader;
View Full Code Here

Examples of org.apache.xbean.asm4.ClassWriter.toByteArray()

        BufferedInputStream bis = new BufferedInputStream(bais);

        ClassWriter cw = new BCClassWriter(ClassWriter.COMPUTE_FRAMES, bc.getClassLoader());
        ClassReader cr = new ClassReader(bis);
        cr.accept(cw, 0);
        return cw.toByteArray();
    }

    private static class BCClassWriter extends ClassWriter {
        private final ClassLoader _loader;
View Full Code Here

Examples of org.apache.xbean.asm5.ClassWriter.toByteArray()

        BufferedInputStream bis = new BufferedInputStream(bais);

        ClassWriter cw = new BCClassWriter(ClassWriter.COMPUTE_FRAMES, bc.getClassLoader());
        ClassReader cr = new ClassReader(bis);
        cr.accept(cw, 0);
        return cw.toByteArray();
    }

    private static class BCClassWriter extends ClassWriter {
        private final ClassLoader _loader;
View Full Code Here

Examples of org.apache.xerces.utils.UTF8DataChunk.toByteArray()

                loadNextByte();
            } else {
                fCurrentChunk = saveChunk;
                fCurrentIndex = saveIndex;
                fCurrentOffset = saveOffset;
                fMostRecentData = saveChunk.toByteArray();
                fMostRecentByte = b0;
            }
            return true; // [#x20-#xD7FF]
        }
        int b2 = loadNextByte();
View Full Code Here

Examples of org.apache.xml.security.stax.impl.util.UnsynchronizedByteArrayOutputStream.toByteArray()

    @Override
    public void doFinal() throws XMLStreamException {
        if (getTransformer() != null) {
            UnsynchronizedByteArrayOutputStream baos = (UnsynchronizedByteArrayOutputStream)getOutputStream();
            getTransformer().transform(new UnsynchronizedByteArrayInputStream(baos.toByteArray()));
            getTransformer().doFinal();
        }
    }

    protected static void outputAttrToWriter(final String prefix, final String name, final String value, final OutputStream writer,
View Full Code Here

Examples of org.arch.compress.jsnappy.SnappyBuffer.toByteArray()

    }

    end = System.currentTimeMillis();
    SnappyBuffer resume = SnappyDecompressor.decompress(afterCompress);
    System.out.println("Snappy Decompress cost " + (end - start) + "ms");
    assertArrayEquals(cmp, resume.toByteArray());
    // Snappy.compress(uncompressed, uncompressedOffset, uncompressedLength,
    // compressed, compressedOffset)
  }

  @Test
View Full Code Here

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

    public byte[] encode( BSONObject o ){
        BasicOutputBuffer buf = new BasicOutputBuffer();
        set( buf );
        putObject( o );
        done();
        return buf.toByteArray();
    }

    public void set( OutputBuffer out ){
        if ( _buf != null )
            throw new IllegalStateException( "in the middle of something" );
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.