*** empty log message ***
[IRC.git] / Robust / Transactions / TransactionalIOSrc / core / FileBlockManager.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package TransactionalIO.core;
6
7 //import Defaults;
8
9
10
11
12
13
14
15
16
17 /**
18  *
19  * @author navid
20  */
21 public class FileBlockManager {
22
23     public static long getFragmentIndexofTheFile(long filesize) {
24         return (filesize / Defaults.FILEFRAGMENTSIZE);
25     }
26
27     public static int getCurrentFragmentIndexofTheFile(long start) {
28         return (int) ((start / Defaults.FILEFRAGMENTSIZE));
29     }
30
31     public static int getTargetFragmentIndexofTheFile(long start, long offset) {
32         return (int) (((offset + start) / Defaults.FILEFRAGMENTSIZE));
33     }
34 }