@Test(expectedExceptions = IllegalArgumentException.class) public void testWriteExcelOverMaxCountExceptionByInputStream() { FileExcelWrite.build(this.getClass().getResourceAsStream("/c.xls"), fileName) .setLargeDataMode(true) .deal(new WriteDeal<ExcelDto>() { public String[] dealBean(ExcelDto obj) { String[] result = new String[3]; result[0] = obj.getId() + ""; result[1] = obj.getName(); result[2] = obj.getAge() + ""; return result; } public int skipLine() { return 4; } @Override public Map<String, Object> additional() { Map<String, Object> map = new HashMap<>(); map.put("quoteCurrency", "ETH"); map.put("symbol", "USDT_ETH"); map.put("startTime", "2019-01-09 00:00:00"); map.put("endTime", "2019-01-09 12:00:00"); return map; } }, ExcelDataList.getList()) .write(); }
public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); }
FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } }
FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private  FileExcelWrite(); }
FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private  FileExcelWrite(); @Override OutputStream createOutputStream(String fileName); static ExcelWrite build(InputStream inputStream, String fileName); static ExcelWrite build(String fileName); }
FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private  FileExcelWrite(); @Override OutputStream createOutputStream(String fileName); static ExcelWrite build(InputStream inputStream, String fileName); static ExcelWrite build(String fileName);  }