public static ByteBufferN allocateDirect(int capacity) { if (capacity < 0) throw new IllegalArgumentException(); return new HeapByteBufferN(capacity, capacity); //TODO ? //return new DirectByteBuffer(capacity); }