Examples of toByteArray()


Examples of io.apigee.trireme.core.CircularOutputStream.toByteArray()

    private void testOneByOne(int initial, int max, int bytes)
        throws IOException
    {
        CircularOutputStream out = new CircularOutputStream(initial, max);
        fill(out, bytes);
        byte[] buf = out.toByteArray();
        verify(buf, (bytes > max) ? (bytes - max) : 0);

        out = new CircularOutputStream(initial, max);
        fillBulk(out, bytes);
        buf = out.toByteArray();
View Full Code Here

Examples of io.fathom.cloud.protobuf.CloudCommons.PeerRequest.toByteArray()

            PeerRequest.Builder prb = entry.getValue();

            PeerRequest pr = prb.build();

            try {
                node.requestExecutor.execute(pr.toByteArray());
            } catch (IOException e) {
                log.error("Error enqueuing peer request", e);
            }
        }
        peerRequests.clear();
View Full Code Here

Examples of io.fathom.cloud.protobuf.CloudCommons.TokenInfo.toByteArray()

            byte[] tokenBytes = Base64Coder.decodeWebSafe(tokenString);

            Token token = Token.parseFrom(tokenBytes);

            TokenInfo tokenInfo = token.getTokenInfo();
            byte[] plaintext = tokenInfo.toByteArray();
            if (!getSigner().verify(plaintext, token.getSignature().toByteArray())) {
                log.debug("Token signature verification failed");
                return null;
            }
View Full Code Here

Examples of it.unimi.dsi.fastutil.bytes.ByteArrayList.toByteArray()

                }
                d.updateDownloadTime();
                if (chunk.size() > outputBuffer.length) {
                    outputBuffer = new byte[chunk.size()];
                }
                processor.doChunck(chunk.size(), chunk.toByteArray(outputBuffer));
                d.setDownloaded(d.getDownloaded() + chunk.size());
                chunk.clear();
                bufferWatch.add();
                //System.out.print(bufferWatch);
                long maxTime = getdSettings().getBufferTime() * 1000000;
 
View Full Code Here

Examples of it.unimi.dsi.fastutil.bytes.ByteList.toByteArray()

                                leftScores.toByteArray(new byte[leftScores.size()]));

                        AlignmentBlock right = AlignmentBlock.getInstance(getChr(), block.getStart() + leftBases.size()
                                + var.getFrom().length(),
                                rightBases.toByteArray(new byte[rightBases.size()]),
                                rightScores.toByteArray(new byte[rightScores.size()]));

                        blocks.remove(block);
                        newBlocks.add(left);
                        newBlocks.add(right);
View Full Code Here

Examples of java.io.ByteArrayInputStream.toByteArray()

                ByteArrayOutputStream stream = new ByteArrayOutputStream();

                getLogger().debug( "Writing resolution-state to: " + touchfile );
                props.store( stream, "Last modified on: " + new Date() );

                byte[] data = stream.toByteArray();
                ByteBuffer buffer = ByteBuffer.allocate( data.length );
                buffer.put( data );
                buffer.flip();

                channel.position( 0 );
View Full Code Here

Examples of java.io.ByteArrayOutputStream.toByteArray()

        "de;GMT+01:00;EUROSPORT;Eurosport;(c) by Eurosport;;;0;\"Eurosport\"\n" +
        "de;GMT+01:00;AXN;AXN;(c) by AXN;http://www.axntv.de;;273;\"AXN\"\n" +
        "de;GMT+01:00;DMAXPUNNY;DMAX PUNNY;(c) by DMAX;http://www.dmaxtv.de/;http://sender.wannawork.de/logos/DMAX.png;257;\"Wöhnungssüche\"\n" +
        "de;GMT+01:00;EUROSPORTPUNNY;Eurosport PUNNY;(c) by Eurosport;;;0;\"Küchendißteln\"\n" +
        "de;GMT+01:00;AXNPUNNY;AXN PUNNY;(c) by AXN;http://www.axntv.de;;273;\"Älbert 獠\"",
        toString(new GZIPInputStream(new ByteArrayInputStream(stream.toByteArray()))));
  }


  /**
   * Writes the content of the input stream to a <code>String<code>.
View Full Code Here

Examples of java.io.FileOutputStream.toByteArray()

                    int len;
                    while ( ( len = in.read( buf ) ) > 0 )
                    {
                        out.write( buf, 0, len );
                    }
                    currentData = out.toByteArray();
                    hexText.setText( toFormattedHex( currentData ) );
                    out.close();
                    in.close();
                }
                catch ( FileNotFoundException e )
View Full Code Here

Examples of java.io.OutputStream.toByteArray()

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    target.getInputStream().copyTo(out);

    request.log(Server.LOG_DIAGNOSTIC,
      "  parsing/modifying " + out.size() + " bytes");
    byte[] content = modifyContent(request, out.toByteArray());

    if (content == null) {  // This is wrong!!
        request.log(Server.LOG_DIAGNOSTIC,
          "  null content, returning false");
        code=false;
View Full Code Here

Examples of java.io.PipedOutputStream.toByteArray()

            }.setParam(mc,(PipedOutputStream) headerOut).start();
            wrapped = new PipedInputStream(headerOut);
        } else {
            ByteArrayOutputStream headerOut = new ByteArrayOutputStream();
            writeStream(mc,headerOut);
            wrapped = new ByteArrayInputStream(headerOut.toByteArray());
            size = headerOut.size();
        }
    }
   
    /**
 
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.