[Joafip-svn] SF.net SVN: joafip:[3089] trunk/joafip-4test/src/main/java/net/sf/joafip/ file/service
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2012-05-21 21:30:13
|
Revision: 3089
http://joafip.svn.sourceforge.net/joafip/?rev=3089&view=rev
Author: luc_peuvrier
Date: 2012-05-21 21:30:06 +0000 (Mon, 21 May 2012)
Log Message:
-----------
2 giga bytes limit test ok
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead3Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStreamMapped.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStreamNIO.java
Removed Paths:
-------------
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java
trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java 2012-05-21 20:59:47 UTC (rev 3088)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -1,91 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- * All rights reserved.
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.file.service;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Arrays;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-public abstract class AbstractWriteRead1Gbyte {
-
- private static final byte[] DATA = new byte[1024];
-
- static {
- for (int index = 0; index < 1024; index++) {
- DATA[index] = (byte) index;
- }
- }
-
- /**
- *
- * @return mS 1 giga byte write duration
- * @throws Exception
- * @throws IOException
- */
- protected long write(final OutputStream outputStream) throws Exception {// NOPMD
- int count = -1;
- try {
- final long beginTime = System.currentTimeMillis();
- for (count = 0; count < 1024 * 1024; count++) {
- outputStream.write(DATA);
- }
- outputStream.close();
- return System.currentTimeMillis() - beginTime;
- } catch (Exception exception) {
- throw new Exception("count " + count + ", size "// NOPMD
- + (count * DATA.length), exception);
- }
- }
-
- protected long read(final InputStream inputStream) throws Exception {// NOPMD
- int count = -1;
- try {
- final byte[] data = new byte[1024];
- final long beginTime = System.currentTimeMillis();
- for (count = 0; count < 1024 * 1024; count++) {
- final int read = inputStream.read(data);
- if (read != 1024) {
- throw new Exception("must read 1024 bytes");// NOPMD
- }
- if (!Arrays.equals(data, DATA)) {
- throw new Exception("bad data");// NOPMD
- }
- }
- final int read = inputStream.read(data);
- if (read != -1) {
- throw new Exception("must be end of file");// NOPMD
- }
- inputStream.close();
- return System.currentTimeMillis() - beginTime;
- } catch (Exception exception) {
- throw new Exception("count " + count + ", size "// NOPMD
- + (count * DATA.length), exception);
- }
- }
-}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead3Gbyte.java (from rev 3087, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead1Gbyte.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead3Gbyte.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/AbstractWriteRead3Gbyte.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public abstract class AbstractWriteRead3Gbyte {
+
+ private static final byte[] DATA = new byte[1024];
+
+ static {
+ for (int index = 0; index < 1024; index++) {
+ DATA[index] = (byte) index;
+ }
+ }
+
+ /**
+ *
+ * @return mS 1 giga byte write duration
+ * @throws Exception
+ * @throws IOException
+ */
+ protected long write(final OutputStream outputStream) throws Exception {// NOPMD
+ int count = -1;
+ try {
+ final long beginTime = System.currentTimeMillis();
+ for (count = 0; count < 3 * 1024 * 1024; count++) {
+ outputStream.write(DATA);
+ }
+ outputStream.close();
+ return System.currentTimeMillis() - beginTime;
+ } catch (Exception exception) {
+ throw new Exception("count " + count + ", size "// NOPMD
+ + (count * DATA.length), exception);
+ }
+ }
+
+ protected long read(final InputStream inputStream) throws Exception {// NOPMD
+ int count = -1;
+ try {
+ final byte[] data = new byte[1024];
+ final long beginTime = System.currentTimeMillis();
+ for (count = 0; count < 3 * 1024 * 1024; count++) {
+ final int read = inputStream.read(data);
+ if (read != 1024) {
+ throw new Exception("must read 1024 bytes");// NOPMD
+ }
+ if (!Arrays.equals(data, DATA)) {
+ throw new Exception("bad data");// NOPMD
+ }
+ }
+ final int read = inputStream.read(data);
+ if (read != -1) {
+ throw new Exception("must be end of file");// NOPMD
+ }
+ inputStream.close();
+ return System.currentTimeMillis() - beginTime;
+ } catch (Exception exception) {
+ throw new Exception("count " + count + ", size "// NOPMD
+ + (count * DATA.length), exception);
+ }
+ }
+}
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java 2012-05-21 20:59:47 UTC (rev 3088)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -1,58 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- * All rights reserved.
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.file.service;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import net.sf.joafip.NotStorableClass;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-public class MainWrite1GByteFileOutputStream extends AbstractWriteRead1Gbyte {
-
- @SuppressWarnings("PMD")
- public static void main(final String[] args) {
- try {
- final File file = new File("runtime/1gb.bin");
- file.delete();
- final MainWriteRead1GByteFileOutputStream main = new MainWriteRead1GByteFileOutputStream();
- final OutputStream outputStream = new FileOutputStream(file);
- System.out.println("write duration " + main.write(outputStream)
- + " mS");// NOPMD
- final InputStream inputStream = new FileInputStream(file);
- System.out.println("read duration " + main.read(inputStream)
- + " mS");// NOPMD
- } catch (Exception exception) {
- exception.printStackTrace();// NOPMD
- }
- }
-}
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java 2012-05-21 20:59:47 UTC (rev 3088)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -1,52 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- * All rights reserved.
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.file.service;
-
-import java.io.File;
-import java.io.OutputStream;
-
-import net.sf.joafip.file.service.stream.FileOutputStreamMapped;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-public class MainWrite1GByteFileOutputStreamMapped extends
- AbstractWriteRead1Gbyte {
-
- @SuppressWarnings("PMD")
- public static void main(final String[] args) {
- try {
- final File file = new File("runtime/1gb.bin");
- file.delete();
- final MainWrite1GByteFileOutputStreamMapped main = new MainWrite1GByteFileOutputStreamMapped();
- final OutputStream outputStream = new FileOutputStreamMapped(file);
- System.out.println("write duration " + main.write(outputStream)
- + " mS");// NOPMD
- } catch (Exception exception) {
- exception.printStackTrace();// NOPMD
- }
- }
-}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStream.java (from rev 3087, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStream.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStream.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStream.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import net.sf.joafip.NotStorableClass;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class MainWrite3GByteFileOutputStream extends AbstractWriteRead3Gbyte {
+
+ @SuppressWarnings("PMD")
+ public static void main(final String[] args) {
+ try {
+ final File file = new File("runtime/3gb.bin");
+ file.delete();
+ final MainWriteRead3GByteFileOutputStream main = new MainWriteRead3GByteFileOutputStream();
+ final OutputStream outputStream = new FileOutputStream(file);
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ final InputStream inputStream = new FileInputStream(file);
+ System.out.println("read duration " + main.read(inputStream)
+ + " mS");// NOPMD
+ } catch (Exception exception) {
+ exception.printStackTrace();// NOPMD
+ }
+ }
+}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStreamMapped.java (from rev 3087, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite1GByteFileOutputStreamMapped.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStreamMapped.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWrite3GByteFileOutputStreamMapped.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+import java.io.OutputStream;
+
+import net.sf.joafip.file.service.stream.FileOutputStreamMapped;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class MainWrite3GByteFileOutputStreamMapped extends
+ AbstractWriteRead3Gbyte {
+
+ @SuppressWarnings("PMD")
+ public static void main(final String[] args) {
+ try {
+ final File file = new File("runtime/3gb.bin");
+ file.delete();
+ final MainWrite3GByteFileOutputStreamMapped main = new MainWrite3GByteFileOutputStreamMapped();
+ final OutputStream outputStream = new FileOutputStreamMapped(file);
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ } catch (Exception exception) {
+ exception.printStackTrace();// NOPMD
+ }
+ }
+}
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java 2012-05-21 20:59:47 UTC (rev 3088)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -1,59 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- * All rights reserved.
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.file.service;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import net.sf.joafip.NotStorableClass;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-public class MainWriteRead1GByteFileOutputStream extends
- AbstractWriteRead1Gbyte {
-
- @SuppressWarnings("PMD")
- public static void main(final String[] args) {
- try {
- final File file = new File("runtime/1gb.bin");
- file.delete();
- final MainWriteRead1GByteFileOutputStream main = new MainWriteRead1GByteFileOutputStream();
- final OutputStream outputStream = new FileOutputStream(file);
- System.out.println("write duration " + main.write(outputStream)
- + " mS");// NOPMD
- final InputStream inputStream = new FileInputStream(file);
- System.out.println("read duration " + main.read(inputStream)
- + " mS");// NOPMD
- } catch (Exception exception) {
- exception.printStackTrace();// NOPMD
- }
- }
-}
Deleted: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java 2012-05-21 20:59:47 UTC (rev 3088)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -1,57 +0,0 @@
-/*
- * Copyright 2012 Luc Peuvrier
- * All rights reserved.
- *
- * This file is a part of JOAFIP.
- *
- * JOAFIP is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License.
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * JOAFIP is distributed in the hope that it will be useful, but
- * unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.file.service;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import net.sf.joafip.file.service.stream.FileOutputStreamNIO;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-public class MainWriteRead1GByteFileOutputStreamNIO extends
- AbstractWriteRead1Gbyte {
-
- @SuppressWarnings("PMD")
- public static void main(final String[] args) {
- try {
- final File file = new File("runtime/1gb.bin");
- file.delete();
- final MainWriteRead1GByteFileOutputStreamNIO main = new MainWriteRead1GByteFileOutputStreamNIO();
- final OutputStream outputStream = new FileOutputStreamNIO(file);
- System.out.println("write duration " + main.write(outputStream)
- + " mS");// NOPMD
- final InputStream inputStream = new FileInputStream(file);
- System.out.println("read duration " + main.read(inputStream)
- + " mS");// NOPMD
- } catch (Exception exception) {
- exception.printStackTrace();// NOPMD
- }
- }
-}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStream.java (from rev 3087, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStream.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStream.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStream.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import net.sf.joafip.NotStorableClass;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class MainWriteRead3GByteFileOutputStream extends
+ AbstractWriteRead3Gbyte {
+
+ @SuppressWarnings("PMD")
+ public static void main(final String[] args) {
+ try {
+ final File file = new File("runtime/3gb.bin");
+ file.delete();
+ final MainWriteRead3GByteFileOutputStream main = new MainWriteRead3GByteFileOutputStream();
+ final OutputStream outputStream = new FileOutputStream(file);
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ final InputStream inputStream = new FileInputStream(file);
+ System.out.println("read duration " + main.read(inputStream)
+ + " mS");// NOPMD
+ } catch (Exception exception) {
+ exception.printStackTrace();// NOPMD
+ }
+ }
+}
Copied: trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStreamNIO.java (from rev 3087, trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead1GByteFileOutputStreamNIO.java)
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStreamNIO.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/file/service/MainWriteRead3GByteFileOutputStreamNIO.java 2012-05-21 21:30:06 UTC (rev 3089)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2012 Luc Peuvrier
+ * All rights reserved.
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.file.service;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import net.sf.joafip.file.service.stream.FileOutputStreamNIO;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class MainWriteRead3GByteFileOutputStreamNIO extends
+ AbstractWriteRead3Gbyte {
+
+ @SuppressWarnings("PMD")
+ public static void main(final String[] args) {
+ try {
+ final File file = new File("runtime/3gb.bin");
+ file.delete();
+ final MainWriteRead3GByteFileOutputStreamNIO main = new MainWriteRead3GByteFileOutputStreamNIO();
+ final OutputStream outputStream = new FileOutputStreamNIO(file);
+ System.out.println("write duration " + main.write(outputStream)
+ + " mS");// NOPMD
+ final InputStream inputStream = new FileInputStream(file);
+ System.out.println("read duration " + main.read(inputStream)
+ + " mS");// NOPMD
+ } catch (Exception exception) {
+ exception.printStackTrace();// NOPMD
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|