예제 #1
0
  @Test
  public void testWriteSmallData() throws Exception {
    final int SMALL_SIZE = 10;
    testData = Random.createRandomByteArray(SMALL_SIZE);
    bfw.write(testData, testfile);

    byte[] data = new byte[SMALL_SIZE];
    FileInputStream fis = new FileInputStream(new File(testfile));

    fis.read(data);
    fis.close();

    assertArrayEquals(testData, data);
  }
예제 #2
0
 @Before
 public void setUp() throws Exception {
   testfile = Files.createTempFile("BinaryFileWriterTest", "").toString();
   testData = Random.createRandomByteArray(SAMPLE_SIZE);
   bfw = new BinaryFileWriter();
 }