diff options
author | Sven Gothel <sgothel@jausoft.com> | 2014-09-29 03:57:30 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2014-09-29 03:57:30 +0200 |
commit | 00a9ee70054872712017b5a14b19aa92068c8420 (patch) | |
tree | 755dab002246d461f422218b75570cf7d6ef2042 /src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java | |
parent | 92a6d2c1476fd562721f231f89afba9342ed8a20 (diff) |
Bug 1080 - Refine MappedByteBuffer*Stream impl. and API [doc], adding stream to stream copy as well as direct memory mapped ByteBuffer access
Diffstat (limited to 'src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java')
-rw-r--r-- | src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java b/src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java index 195bef3..61961a3 100644 --- a/src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java +++ b/src/junit/com/jogamp/common/nio/TestByteBufferInputStream.java @@ -84,15 +84,15 @@ public class TestByteBufferInputStream extends JunitTracer { static final String fileTwoPlusGiB = "./testTwoPlusGiB.bin" ; static final String fileOut = "./testOut.bin" ; - static final String printPrecision = "%8.3f"; - static final double mib = 1024.0*1024.0; + public static final String PrintPrecision = "%8.3f"; + public static final double MIB = 1024.0*1024.0; @BeforeClass public static void setup() throws IOException { final Runtime runtime = Runtime.getRuntime(); - System.err.printf("Total Memory : "+printPrecision+" MiB%n", runtime.totalMemory() / mib); - System.err.printf("Max Memory : "+printPrecision+" MiB%n", runtime.maxMemory() / mib); + System.err.printf("Total Memory : "+PrintPrecision+" MiB%n", runtime.totalMemory() / MIB); + System.err.printf("Max Memory : "+PrintPrecision+" MiB%n", runtime.maxMemory() / MIB); setup(fileHalfMiB, halfMiB); setup(fileOneMiB, oneMiB); @@ -189,7 +189,7 @@ public class TestByteBufferInputStream extends JunitTracer { final long[] usedMem1 = { 0 }; final long[] freeMem1 = { 0 }; - final String prefix = "test #"+iter+" "+String.format(printPrecision+" MiB", expSize/mib); + final String prefix = "test #"+iter+" "+String.format(PrintPrecision+" MiB", expSize/MIB); System.err.printf("%s: mode %-5s, bufferSize %9d: BEGIN%n", prefix, srcType.toString(), bufferSize); dumpMem(prefix+" before", runtime, -1, -1, usedMem0, freeMem0 ); @@ -323,17 +323,17 @@ public class TestByteBufferInputStream extends JunitTracer { } } - static void dumpMem(final String pre, - final Runtime runtime, final long usedMem0, - final long freeMem0, final long[] usedMemN, - final long[] freeMemN ) + public static void dumpMem(final String pre, + final Runtime runtime, final long usedMem0, + final long freeMem0, final long[] usedMemN, + final long[] freeMemN ) { usedMemN[0] = runtime.totalMemory() - runtime.freeMemory(); freeMemN[0] = runtime.freeMemory(); - System.err.printf("%s Used Memory : "+printPrecision, pre, usedMemN[0] / mib); + System.err.printf("%s Used Memory : "+PrintPrecision, pre, usedMemN[0] / MIB); if( 0 < usedMem0 ) { - System.err.printf(", delta "+printPrecision, (usedMemN[0]-usedMem0) / mib); + System.err.printf(", delta "+PrintPrecision, (usedMemN[0]-usedMem0) / MIB); } System.err.println(" MiB"); /** |