Examples of ChunkInputStream


Examples of org.apache.james.mailbox.hbase.io.ChunkInputStream

                + " qui officia deserunt mollit anim id est laborum";
        byte[] data = Bytes.toBytes(original);
        // we make the column size = 10 bytes
        ChunkOutputStream out = new ChunkOutputStream(conf,
                MESSAGES_TABLE, MESSAGE_DATA_BODY_CF, Bytes.toBytes("10"), 10);
        ChunkInputStream in = new ChunkInputStream(conf,
                MESSAGES_TABLE, MESSAGE_DATA_BODY_CF, Bytes.toBytes("10"));
        //create the stream
        ByteArrayInputStream bin = new ByteArrayInputStream(data);
        ByteArrayOutputStream bout = new ByteArrayOutputStream(data.length);
        int b;
        while ((b = bin.read()) != -1) {
            out.write(b);
        }
        out.close();
        while ((b = in.read()) != -1) {
            bout.write(b);
        }
        String s = bout.toString();
        assertTrue(original.equals(s));
    }
View Full Code Here

Examples of org.apache.james.mailbox.hbase.io.ChunkInputStream

     * (non-Javadoc)
     * @see org.apache.james.mailbox.store.mail.model.Message#getBodyContent()
     */
    @Override
    public InputStream getBodyContent() throws IOException {
        return new ChunkInputStream(conf, MESSAGES_TABLE, MESSAGE_DATA_BODY_CF, messageRowKey(this));
    }
View Full Code Here

Examples of org.apache.james.mailbox.hbase.io.ChunkInputStream

     * (non-Javadoc)
     * @see org.apache.james.mailbox.store.mail.model.Message#getHeaderContent()
     */
    @Override
    public InputStream getHeaderContent() throws IOException {
        return new ChunkInputStream(conf, MESSAGES_TABLE, MESSAGE_DATA_HEADERS_CF, messageRowKey(this));
    }
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.