Package org.apache.bookkeeper.streaming
Class LedgerInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.bookkeeper.streaming.LedgerInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class LedgerInputStream extends java.io.InputStreamAn input stream on reading data from a ledger.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]bbytes(package private) intdefaultSize(package private) intincrement(package private) longlastEntry(package private) java.util.Enumeration<LedgerEntry>ledgerSeq
-
Constructor Summary
Constructors Constructor Description LedgerInputStream(LedgerHandle lh)construct a outputstream from a ledger handle.LedgerInputStream(LedgerHandle lh, int size)construct a outputstream from a ledger handle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Method close currently doesn't do anything.intread()intread(byte[] b)intread(byte[] b, int off, int len)
-
-
-
Field Detail
-
bbytes
byte[] bbytes
-
lastEntry
long lastEntry
-
increment
int increment
-
defaultSize
int defaultSize
-
ledgerSeq
java.util.Enumeration<LedgerEntry> ledgerSeq
-
-
Constructor Detail
-
LedgerInputStream
public LedgerInputStream(LedgerHandle lh) throws BKException, java.lang.InterruptedException
construct a outputstream from a ledger handle.- Parameters:
lh- ledger handle- Throws:
BKException- when encountered bookkeeper exceptionsjava.lang.InterruptedException- when opening a ledger input stream is interrupted.
-
LedgerInputStream
public LedgerInputStream(LedgerHandle lh, int size) throws BKException, java.lang.InterruptedException
construct a outputstream from a ledger handle.- Parameters:
lh- the ledger handlesize- the size of the buffer- Throws:
BKException- when encountered bookkeeper exceptionsjava.lang.InterruptedException- when opening a ledger input stream is interrupted.
-
-
Method Detail
-
close
public void close()
Method close currently doesn't do anything. The application is supposed to open and close the ledger handle backing up a stream (LedgerHandle).- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
-