static byte[] readFile(String filename) throws IOException {
        FileInputStream fis = new FileInputStream(filename);
        byte[] data = new byte[1000];
        int tot = fis.read(data);
        if (tot == -1) {
            throw new IOException("Could not read from file " + filename);
        }

        return data;
    }
Test for Document and all its features, including (de)serialization.

@author Thomas Gundersen
@author bratseth
document/src/test/java/com/yahoo/document/DocumentTestCase.java