Class LedgerInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class LedgerInputStream
    extends java.io.InputStream
    An input stream on reading data from a ledger.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Method close currently doesn't do anything.
      int read()  
      int read​(byte[] b)  
      int read​(byte[] b, int off, int len)  
      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, reset, skip
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 exceptions
        java.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 handle
        size - the size of the buffer
        Throws:
        BKException - when encountered bookkeeper exceptions
        java.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:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException