Class DiskStorage

  • All Implemented Interfaces:
    java.lang.AutoCloseable, Storage

    public class DiskStorage
    extends java.lang.Object
    implements Storage
    • Constructor Summary

      Constructors 
      Constructor Description
      DiskStorage​(java.io.File folder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void init​(Store store)  
      byte[] load​(int index, int archive)  
      void load​(Store store)  
      byte[] readIndex​(int indexId)  
      void save​(Store store)  
      void store​(int index, int archive, byte[] archiveData)  
      • Methods inherited from class java.lang.Object

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

      • DiskStorage

        public DiskStorage​(java.io.File folder)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • init

        public void init​(Store store)
                  throws java.io.IOException
        Specified by:
        init in interface Storage
        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 Storage
        Throws:
        java.io.IOException
      • load

        public void load​(Store store)
                  throws java.io.IOException
        Specified by:
        load in interface Storage
        Throws:
        java.io.IOException
      • readIndex

        public byte[] readIndex​(int indexId)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public void save​(Store store)
                  throws java.io.IOException
        Specified by:
        save in interface Storage
        Throws:
        java.io.IOException
      • load

        public byte[] load​(int index,
                           int archive)
                    throws java.io.IOException
        Specified by:
        load in interface Storage
        Throws:
        java.io.IOException
      • store

        public void store​(int index,
                          int archive,
                          byte[] archiveData)
                   throws java.io.IOException
        Specified by:
        store in interface Storage
        Throws:
        java.io.IOException