Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.inrialpes.exmo.data;
- import java.io.*;
- import java.util.Arrays;
- import org.apache.commons.lang3.StringUtils;
- import fr.inrialpes.exmo.data.LinkMatrix;
- public class RandomAccessFileDemo {
- public static void main(String[] args) throws IOException {
- try {
- // create a new RandomAccessFile with filename test
- RandomAccessFile raf = new RandomAccessFile("result.txab", "rw");
- LinkMatrix extendedLinks = LinkMatrix.create();
- while (raf.readLine() != null) {
- //System.out.println(raf.readLine());
- String line = raf.readLine();
- String[] parts = StringUtils.split(line, "\\|");
- extendedLinks.put(parts[0], parts[2], new String[] {parts[0], parts[1], parts[2], parts[3]});
- }
- System.out.println("size = " + extendedLinks.size());
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement