@Override public void setPageCount(long count) throws IOException { if (count < 0) { throw new IllegalArgumentException(String.valueOf(count)); } if (isReadOnly()) { return; } mFio.setLength(count * mPageSize); }
private static PageArray openPageArray(int pageSize, File[] files, FileFactory factory, EnumSet<OpenOption> options) throws IOException { checkPageSize(pageSize); if (!options.contains(OpenOption.CREATE)) { for (File file : files) { if (!file.exists()) { throw new DatabaseException("File does not exist: " + file); } } } if (files.length == 0) { throw new IllegalArgumentException("No files provided"); } if (files.length == 1) { return new FilePageArray(pageSize, files[0], factory, options); } PageArray[] arrays = new PageArray[files.length]; for (int i=0; i<files.length; i++) { arrays[i] = new FilePageArray(pageSize, files[i], factory, options); } return new StripedPageArray(arrays); }
private static PageArray openPageArray(int pageSize, File[] files, FileFactory factory, EnumSet<OpenOption> options) throws IOException { checkPageSize(pageSize); if (!options.contains(OpenOption.CREATE)) { for (File file : files) { if (!file.exists()) { throw new DatabaseException("File does not exist: " + file); } } } if (files.length == 0) { throw new IllegalArgumentException("No files provided"); } if (files.length == 1) { return new FilePageArray(pageSize, files[0], factory, options); } PageArray[] arrays = new PageArray[files.length]; for (int i=0; i<files.length; i++) { arrays[i] = new FilePageArray(pageSize, files[i], factory, options); } return new StripedPageArray(arrays); }
private static PageArray openPageArray(int pageSize, File[] files, FileFactory factory, EnumSet<OpenOption> options) throws IOException { checkPageSize(pageSize); if (!options.contains(OpenOption.CREATE)) { for (File file : files) { if (!file.exists()) { throw new DatabaseException("File does not exist: " + file); } } } if (files.length == 0) { throw new IllegalArgumentException("No files provided"); } if (files.length == 1) { return new FilePageArray(pageSize, files[0], factory, options); } PageArray[] arrays = new PageArray[files.length]; for (int i=0; i<files.length; i++) { arrays[i] = new FilePageArray(pageSize, files[i], factory, options); } return new StripedPageArray(arrays); }
@Override public void setPageCount(long count) throws IOException { if (count < 0) { throw new IllegalArgumentException(String.valueOf(count)); } if (isReadOnly()) { return; } mFio.setLength(count * mPageSize); }
private static PageArray openPageArray(int pageSize, File[] files, FileFactory factory, EnumSet<OpenOption> options) throws IOException { checkPageSize(pageSize); if (!options.contains(OpenOption.CREATE)) { for (File file : files) { if (!file.exists()) { throw new DatabaseException("File does not exist: " + file); } } } if (files.length == 0) { throw new IllegalArgumentException("No files provided"); } if (files.length == 1) { return new FilePageArray(pageSize, files[0], factory, options); } PageArray[] arrays = new PageArray[files.length]; for (int i=0; i<files.length; i++) { arrays[i] = new FilePageArray(pageSize, files[i], factory, options); } return new StripedPageArray(arrays); }
@Override public void setPageCount(long count) throws IOException { if (count < 0) { throw new IllegalArgumentException(String.valueOf(count)); } if (isReadOnly()) { return; } mFio.setLength(count * mPageSize); }
return new FilePageArray(pageSize, files[0], factory, options); arrays[i] = new FilePageArray(pageSize, files[i], factory, options);
return new FilePageArray(pageSize, files[0], factory, options); arrays[i] = new FilePageArray(pageSize, files[i], factory, options);