public static PersistentBuffer getPersistentBuffer(RandomAccessFile raf, ProtectionLevel protectionLevel, long maximumCapacity) throws IOException {
		if(maximumCapacity<(1L<<30)) {
			long len = raf.length();
			if(maximumCapacity<len) maximumCapacity = len;
		}
		// If < 1 GB, use mapped buffer
		if(maximumCapacity<(1L<<30)) {
			return new MappedPersistentBuffer(raf, protectionLevel);
		}
		// No mmap for 32-bit
		String dataModel = System.getProperty("sun.arch.data.model");
		if(
			"32".equals(dataModel)
		) {
			return new RandomAccessFileBuffer(raf, protectionLevel);
		}
		// Use mmap for 64-bit
		if(
			!"64".equals(dataModel)
		) {
			logger.log(Level.WARNING, "Unexpected value for system property sun.arch.data.model, assuming 64-bit virtual machine: sun.arch.data.model={0}", dataModel);
		}
		return new LargeMappedPersistentBuffer(raf, protectionLevel);
	}
public static PersistentBuffer getPersistentBuffer ( RandomAccessFile raf , ProtectionLevel protectionLevel , long maximumCapacity ) throws IOException { if ( maximumCapacity < ( 1L << 30 ) ) { long len = raf . length ( ) ; if ( maximumCapacity < len ) maximumCapacity = len ; } if ( maximumCapacity < ( 1L << 30 ) ) { return new MappedPersistentBuffer ( raf , protectionLevel ) ; } String dataModel = System . getProperty ( "sun.arch.data.model" ) ; if ( "32" . equals ( dataModel ) ) { return new RandomAccessFileBuffer ( raf , protectionLevel ) ; } if ( ! "64" . equals ( dataModel ) ) { logger . log ( Level . WARNING , "Unexpected value for system property sun.arch.data.model, assuming 64-bit virtual machine: sun.arch.data.model={0}" , dataModel ) ; } return new LargeMappedPersistentBuffer ( raf , protectionLevel ) ; }
@ThreadSafe