This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
import java.util.Random; | |
public class BufferPerformanceComparison { | |
public final static int MEGA_BYTE = 1024 * 1024; | |
public final static long GIGA_BYTE = MEGA_BYTE * 1024; | |
private final ByteBuffer heapByteBuffer; | |
private final ByteBuffer offHeapByteBuffer; | |
private final long dataToLoad; | |
private final int bufferSize; |