| 146 | } |
| 147 | |
| 148 | public void Store(String text) {//store the TSet and XSet entries |
| 149 | try { |
| 150 | FileOutputStream file = new FileOutputStream("data/EDB/JXT_" + text + ".dat"); |
| 151 | //table1 |
| 152 | for (BigInteger token : tset.keySet()) { |
| 153 | file.write(token.toByteArray()); |
| 154 | ArrayList<tuple> tuples = tset.get(token); |
| 155 | for (tuple t : tuples){ |
| 156 | file.write(t.ct); |
| 157 | for (int i = 0; i < t.h_x.length; i++) { |
| 158 | file.write(t.h_x[i]); |
| 159 | file.write(t.h_y[i]); |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | byte[][] xset1 = f.getData(); |
| 164 | for (int i = 0; i < xset1.length; i++) { |
| 165 | file.write(xset1[i]); |
| 166 | } |
| 167 | file.close(); |
| 168 | } catch (IOException e) { |
| 169 | System.out.println("Error - " + e.toString()); |
| 170 | } |
| 171 | } |
| 172 | } |