Examples of toByteArray()


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

      cw.visit(V1_6, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, interfaceResourcePath, null, "java/lang/Object",
          toResourcePaths(interfacesToImplement));
      cw.visitSource(interfaceResourcePath + ".java", null);
      cw.visitEnd();

      return cw.toByteArray();
    }

    private static String[] toResourcePaths(Class<?>... interfacesToImplement) {

      List<String> interfaceResourcePaths = new ArrayList<String>(interfacesToImplement.length);
View Full Code Here

Examples of org.springframework.jca.cci.core.support.CommAreaRecord.toByteArray()

  }

  protected final Object extractOutputData(Record record) throws DataAccessException {
    CommAreaRecord commAreaRecord = (CommAreaRecord) record;
    try {
      return bytesToObject(commAreaRecord.toByteArray());
    }
    catch (IOException ex) {
      throw new DataRetrievalFailureException("I/O exception during bytes conversion", ex);
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.internal.ByteVector.toByteArray()

                  byteVector.add(b);
                }
                if (byteVector.size() == 0) {
                  flags = Flags.RegularFile;
                } else {
                  flags = Flags.parse(byteVector.toByteArray(), 0, byteVector.size());
                }
              }
              if (delegate != null) {
                assert flags != null;
                assert fileRev != null;
View Full Code Here

Examples of org.tmatesoft.hg.internal.DataSerializer.ByteArraySerializer.toByteArray()

      if (fp.first() != NO_REVISION && fp.second() == NO_REVISION && !isNewFile) {
        // compare file contents to see if anything has changed, and reuse old revision, if unchanged.
        // XXX ineffective, need better access to revision conten
        ByteArraySerializer bas = new ByteArraySerializer();
        bds.serialize(bas);
        final byte[] newContent = bas.toByteArray();
        // unless there's a way to reset DataSource, replace it with the content just read
        bds = new DataSerializer.ByteArrayDataSource(newContent);
        if (new ComparatorChannel(newContent).same(df, fp.first())) {
          fileRev = df.getRevision(fp.first());
        }
View Full Code Here

Examples of org.waveprotocol.box.server.persistence.protos.ProtoAccountStoreData.ProtoAccountData.toByteArray()

    File accountFile = new File(participantIdToFileName(account.getId()));
    OutputStream file = null;
    try {
      file = new FileOutputStream(accountFile);
      ProtoAccountData data = ProtoAccountDataSerializer.serialize(account);
      file.write(data.toByteArray());
      file.flush();
    } catch (IOException e) {
      LOG.severe("Failed to write account data to file: " + accountFile.getAbsolutePath(), e);
      throw new PersistenceException(e);
    } finally {
View Full Code Here

Examples of org.waveprotocol.wave.federation.Proto.ProtocolHashedVersion.toByteArray()

    for (int fetchNum = 0; version.getVersion() != lastVersion.getVersion(); fetchNum++) {
      Console.print("    getting deltas from version " + version.getVersion() + " ...");
      final List<byte[]> deltas = Lists.newArrayList();
      final AtomicReference<byte[]> targetVersion = new AtomicReference<byte[]>();
      api.exportRawDeltas(waveId, waveletId,
          version.toByteArray(), lastVersion.toByteArray(), rpcServerUrl, new RawDeltasListener() {
        @Override
        public void onSuccess(List<byte[]> rawDeltas, byte[] rawTargetVersion) {
          deltas.addAll(rawDeltas);
          targetVersion.set(rawTargetVersion);
        }
View Full Code Here

Examples of org.waveprotocol.wave.federation.Proto.ProtocolWaveletDelta.toByteArray()

    context.getDeltas(waveletName, participant, fromVersion, toVersion, new Receiver<TransformedWaveletDelta>() {

          @Override
          public boolean put(TransformedWaveletDelta delta) {
            ProtocolWaveletDelta protoDelta = CoreWaveletOperationSerializer.serialize(delta);
            byte[] bytes = protoDelta.toByteArray();
            deltaBytes.add(bytes);
            version.set(delta.getResultingVersion());
            return length.addAndGet(bytes.length) < GET_HISTORY_BYTES_LENGTH_LIMIT;
          }
        });
View Full Code Here

Examples of org.xbill.DNS.DNSOutput.toByteArray()

  m_h = new Header(raw);
 
  DNSOutput dout = new DNSOutput();
  m_h.toWire(dout);
 
  byte[] out = dout.toByteArray();

  assertEquals(12, out.length);
  for( int i=0; i<out.length; ++i){
      assertEquals(raw[i], out[i]);
  }
View Full Code Here

Examples of org.xmlBlaster.util.xbformat.ByteArray.toByteArray()

               if (o instanceof String) {
                  content = ((String)o).getBytes(Constants.UTF8_ENCODING);
               } else if (o instanceof InputStream) {
                  InputStream is = (InputStream) o;
                  ByteArray ba = new ByteArray(p.getSize() > 0 ? p.getSize() : 1024, is);
                  content = ba.toByteArray();
               } else {
                  content = (o.toString()).getBytes(Constants.UTF8_ENCODING);
               }
              
               if (p instanceof MimeBodyPart && Constants.EMAIL_TRANSFER_ENCODING.equals(((MimeBodyPart)p).getEncoding())) {
View Full Code Here

Examples of parquet.bytes.BytesInput.toByteArray()

        uncompressedSize,
        codecName);
      // COPY the data back into the output buffer.
      // (DrillBufs can only refer to direct memory, so we cannot pass back a BytesInput backed
      // by a byte array).
      outBuffer.put(outBytesInp.toByteArray());
    }
    return new HadoopByteBufBytesInput(outBuffer, 0, outBuffer.limit());
  }

  private DirectDecompressionCodec getCodec(CompressionCodecName codecName) {
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.