Class FixedSizeDataStore.SectorOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    Enclosing class:
    FixedSizeDataStore

    private class FixedSizeDataStore.SectorOutputStream
    extends java.io.OutputStream
    A buffered OutputStream object that writes all data written to the stream out to the store.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] buf
      The sector buffers.
      private int count
      Total bytes written.
      private int cur_sector
      The cur sector to use.
      private int first_sector
      The first sector we wrote to.
      private int index
      Current index in the buffer
      private int last_sector
      The last sector we wrote to.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void flush()  
      void write​(byte[] b, int offset, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        nullOutputStream, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buf

        private final byte[] buf
        The sector buffers.
      • first_sector

        private int first_sector
        The first sector we wrote to.
      • cur_sector

        private int cur_sector
        The cur sector to use.
      • last_sector

        private int last_sector
        The last sector we wrote to.
      • index

        private int index
        Current index in the buffer
      • count

        private int count
        Total bytes written.
    • Constructor Detail

      • SectorOutputStream

        SectorOutputStream()
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int offset,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException