Package org.apache.bookkeeper.streaming
Class LedgerOutputStream
- java.lang.Object
- 
- java.io.OutputStream
- 
- org.apache.bookkeeper.streaming.LedgerOutputStream
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.AutoCloseable
 
 public class LedgerOutputStream extends java.io.OutputStreamthis class provides a streaming api to get an output stream from a ledger handle and write to it as a stream of bytes. This is built on top of ledgerhandle api and uses a buffer to cache the data written to it and writes out the entry to the ledger.
- 
- 
Field SummaryFields Modifier and Type Field Description (package private) byte[]bbytes(package private) intdefaultSize
 - 
Constructor SummaryConstructors Constructor Description LedgerOutputStream(LedgerHandle lh)construct a outputstream from a ledger handle.LedgerOutputStream(LedgerHandle lh, int size)construct a outputstream from a ledger handle.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
 
- 
- 
- 
Constructor Detail- 
LedgerOutputStreampublic LedgerOutputStream(LedgerHandle lh) construct a outputstream from a ledger handle.- Parameters:
- lh- ledger handle
 
 - 
LedgerOutputStreampublic LedgerOutputStream(LedgerHandle lh, int size) construct a outputstream from a ledger handle.- Parameters:
- lh- the ledger handle
- size- the size of the buffer
 
 
- 
 - 
Method Detail- 
closepublic void close() - Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- java.io.OutputStream
 
 - 
flushpublic void flush() - Specified by:
- flushin interface- java.io.Flushable
- Overrides:
- flushin class- java.io.OutputStream
 
 - 
writepublic void write(byte[] b) - Overrides:
- writein class- java.io.OutputStream
 
 - 
writepublic void write(byte[] b, int off, int len)- Overrides:
- writein class- java.io.OutputStream
 
 - 
writepublic void write(int b) throws java.io.IOException- Specified by:
- writein class- java.io.OutputStream
- Throws:
- java.io.IOException
 
 
- 
 
-