| 150 | } |
| 151 | |
| 152 | @SuppressWarnings("resource") |
| 153 | private static void storeFCAlt(int[] ints) { |
| 154 | ByteBuffer buffer = ByteBuffer.allocate(4 * ints.length); |
| 155 | for (int i : ints) |
| 156 | buffer.putInt(i); |
| 157 | |
| 158 | FileChannel fc = null; |
| 159 | try { |
| 160 | fc = new FileInputStream("").getChannel(); |
| 161 | fc = new FileOutputStream("fcalt.out").getChannel(); |
| 162 | fc.write(buffer); |
| 163 | } catch (FileNotFoundException e) { |
| 164 | e.printStackTrace(); |
| 165 | } catch (IOException e) { |
| 166 | e.printStackTrace(); |
| 167 | } finally { |
| 168 | safeClose(fc); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | // safe close helpers |
| 173 | |