Examples of writeTo()


Examples of org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeBits.writeTo()

        } else if (isAggregate) {
            bits = bitsMgr.getBits(declAggrNames);
        } else {
            bits = next();
        }
        bits.writeTo(privNode.getTree());
    }

    private static Collection<PrivilegeDefinition> getBuiltInDefinitions() {
        Map<String, PrivilegeDefinition> definitions = new LinkedHashMap<String, PrivilegeDefinition>();
        for (String privilegeName : NON_AGGR_PRIVILEGES) {
View Full Code Here

Examples of org.apache.james.mime4j.dom.BinaryBody.writeTo()

    }

    private String getBinPart(Entity part) throws IOException {
        BinaryBody bb = (BinaryBody) part.getBody();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        bb.writeTo(baos);
        return new String(baos.toByteArray());
    }

    /*
     * taken from http://svn.apache.org/repos/asf/james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java
View Full Code Here

Examples of org.apache.james.mime4j.dom.TextBody.writeTo()

     *  code taken from http://www.mozgoweb.com/posts/how-to-parse-mime-message-using-mime4j-library/
     */
    static String getTextPart(Entity part) throws IOException {
        TextBody tb = (TextBody) part.getBody();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        tb.writeTo(baos);
        return baos.toString(MailArchiveServerConstants.DEFAULT_ENCODER.charset().name());
    }

    static Map<String, Object> getMessagePropertiesFromHeader(Header hdr) {
        Map<String, Object> props = new HashMap<String, Object>();
View Full Code Here

Examples of org.apache.james.mime4j.message.Header.writeTo()

        assertNotNull(field);
        assertEquals(hello, field.getBody());
       
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
       
        header.writeTo(buffer, MessageUtils.STRICT_IGNORE);
        String s = buffer.toString(MessageUtils.ASCII.name());
       
        assertEquals("Hello: Gr?ezi_z?m?\r\n\r\n", s);

        buffer.reset();
View Full Code Here

Examples of org.apache.james.mime4j.message.Message.writeTo()

    protected void runTest() throws Throwable {
        MimeEntityConfig config = new MimeEntityConfig();
        config.setMaxLineLen(-1);
        Message inputMessage = new Message(new FileInputStream(file), config);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        inputMessage.writeTo(out, MessageUtils.LENIENT);
       
        String msgoutFile = file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf('.')) + ".out";
        String msgoutFileMime4j = file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf('.')) + ".mime4j.out";
       
        try {
View Full Code Here

Examples of org.apache.kafka.common.protocol.types.Struct.writeTo()

        Struct resp = new Struct(ProtoUtils.currentResponseSchema(ApiKeys.PRODUCE.id));
        resp.set("responses", new Object[0]);
        int size = respHeader.sizeOf() + resp.sizeOf();
        ByteBuffer buffer = ByteBuffer.allocate(size);
        respHeader.writeTo(buffer);
        resp.writeTo(buffer);
        buffer.flip();
        selector.completeReceive(new NetworkReceive(node.id(), buffer));
        List<ClientResponse> responses = client.poll(new ArrayList<ClientRequest>(), 1, time.milliseconds());
        assertEquals(1, responses.size());
        ClientResponse response = responses.get(0);
View Full Code Here

Examples of org.apache.kafka.common.requests.ResponseHeader.writeTo()

        ResponseHeader respHeader = new ResponseHeader(reqHeader.correlationId());
        Struct resp = new Struct(ProtoUtils.currentResponseSchema(ApiKeys.PRODUCE.id));
        resp.set("responses", new Object[0]);
        int size = respHeader.sizeOf() + resp.sizeOf();
        ByteBuffer buffer = ByteBuffer.allocate(size);
        respHeader.writeTo(buffer);
        resp.writeTo(buffer);
        buffer.flip();
        selector.completeReceive(new NetworkReceive(node.id(), buffer));
        List<ClientResponse> responses = client.poll(new ArrayList<ClientRequest>(), 1, time.milliseconds());
        assertEquals(1, responses.size());
View Full Code Here

Examples of org.apache.lucene.store.RAMOutputStream.writeTo()

      // Serialize empty-string output:
      RAMOutputStream ros = new RAMOutputStream();
      outputs.writeFinalOutput(emptyOutput, ros);
     
      byte[] emptyOutputBytes = new byte[(int) ros.getFilePointer()];
      ros.writeTo(emptyOutputBytes, 0);

      if (!packed) {
        // reverse
        final int stopAt = emptyOutputBytes.length/2;
        int upto = 0;
View Full Code Here

Examples of org.apache.maven.surefire.util.ScanResult.writeTo()

        System.out.println( "classNames " + classNames.toString() );
        assertEquals( 1, classNames.size() );
        System.out.println(classNames.getClassName(0));

        Properties props = new Properties();
        classNames.writeTo( props );
        assertEquals( 1, props.size() );
    }

    private File writeTestFile() throws Exception {
        File output = new File("target/DependenciesScannerTest-tests.jar");
View Full Code Here

Examples of org.apache.poi.xssf.model.CommentsTable.writeTo()

                        SHEET_COMMENTS.getFileName(sheetNumber));
                    part.addRelationship(ctName, TargetMode.INTERNAL, SHEET_COMMENTS.getRelation(), "rComments");
                    PackagePart ctPart = pkg.createPart(ctName, SHEET_COMMENTS.getContentType());
                   
                    out = ctPart.getOutputStream();
                    ct.writeTo(out);
                    out.close();
                }
            }
            
            // Write shared strings and styles
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.