package com.company;

import com.company.file_access.StructureHandler;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;

public class Main {

    public static void main(String[] args) {
        String fileName = "test.ts";
        File file = new File(fileName);
        RandomAccessFile raf;

        long[][] sizes = new long[2][4];
        sizes[0][0] = 1000;
        sizes[0][1] = 3100;
        sizes[0][2] = 3200;
        sizes[0][3] = 2300;

        sizes[1][0] = 3000;
        sizes[1][1] = 3100;
        sizes[1][2] = 4200;
        sizes[1][3] = 1300;



        StructureHandler handler = null;
        try {
            if (file.exists()) {
                raf = new RandomAccessFile(file, "rw");
                handler = new StructureHandler(raf);
            } else {
                raf = new RandomAccessFile(file, "rw");
                handler = StructureHandler.createStructureHandler(raf,sizes);
            }
        }catch (IOException e){
            System.out.println("lol1");
        }

        if(handler == null){
            System.out.println("lol2");
            return;
        }

        for (int i = 0; i < handler.countOfTables(); i++) {
            System.out.println(handler.getTableSize(i));
        }
        System.out.println();
        for (int i = 0; i < handler.countOfIndeces(); i++) {
            System.out.println(handler.getIndexSize(i));
        }
    }
}

@@ -26,97 +26,20 @@
 ort 
-com.company.file_access.StructureHandler;%0Aimport java.io.File;%0Aimport java.io.IOException
+java.io.File
 ;%0Aim
@@ -511,18 +511,16 @@
  1300;%0A%0A
-%0A%0A
         
@@ -524,832 +524,46 @@
    S
-tructureHandler handler = null;%0A        try %7B%0A            if (file.exists()) %7B%0A                raf = new RandomAccessFile(file, %22rw%22);%0A                handler = new StructureHandler(raf);%0A            %7D else %7B%0A                raf = new RandomAccessFile(file, %22rw%22);%0A                handler = StructureHandler.createStructureHandler(raf,sizes);%0A            %7D%0A        %7Dcatch (IOException e)%7B%0A            System.out.println(%22lol1%22);%0A        %7D%0A%0A        if(handler == null)%7B%0A            System.out.println(%22lol2%22);%0A            return;%0A        %7D%0A%0A        for (int i = 0; i %3C handler.countOfTables(); i++) %7B%0A            System.out.println(handler.getTableSize(i));%0A        %7D%0A        System.out.println();%0A        for (int i = 0; i %3C handler.countOfIndeces(); i++) %7B%0A            System.out.println(handler.getIndexSize(i));%0A        %7D
+impleDB db = new SimpleDB(fileName);%0A%0A
 %0A   

Test SimpleDB in main()