-/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
+/*******************************************************************************
+ * Copyright (c) 2010 Association for Decentralized Information Management in
+ * Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
package org.simantics.databoard.tests;
-import java.io.File;\r
-import java.io.IOException;\r
-import java.io.RandomAccessFile;\r
-\r
-import junit.framework.TestCase;\r
-\r
-import org.simantics.databoard.util.binary.BinaryFile;\r
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+import junit.framework.TestCase;
+
+import org.simantics.databoard.util.binary.BinaryFile;
public class testFileUtil extends TestCase {
for (int iter=0; iter<iterCount; iter++) {
// Verify content
// 1. half
- file = new RandomAccessFile(tmp1, "rw");\r
+ file = new RandomAccessFile(tmp1, "rw");
BinaryFile read = new BinaryFile(file);
read.position(0);
for (int i=0; i<1024*1024; i++)
assertEquals(i^0x53, read.readInt());
- read.close();\r
+ read.close();
file.close();
// Add 256 kb at 2MB
System.gc();
long startTime = System.currentTimeMillis();
- file = new RandomAccessFile(tmp1, "rw");\r
+ file = new RandomAccessFile(tmp1, "rw");
BinaryFile.insertBytes(file, 512*1024*4, 256*1024);
long elapsedTime = System.currentTimeMillis() - startTime;
totInsertTime += elapsedTime;
read.position(512*1024*4+256*1024);
for (int i=512*1024; i<1024*1024; i++)
assertEquals(i^0x53, read.readInt());
- read.close();\r
+ read.close();
file.close();
// Remove content
- file = new RandomAccessFile(tmp1, "rw");\r
+ file = new RandomAccessFile(tmp1, "rw");
System.gc();
startTime = System.currentTimeMillis();
BinaryFile.removeBytes(file, 512*1024*4, 256*1024);