檔案讀寫操作
- 原則上避免直接操作 Java File,所以提供 FileReadFacade/FileWriteFacade 以取得相關 Stream / Reader / Writer 等串流物件操作。
- 資料量不大的時候,也可以直接寫入/讀取內容。
- 於 Srping 環境注入即可使用。
FileReadFacade
createReader(LogicalFile)
createReader(LogicalFile, String charsetName)
createStream(LogicalFile)
readByteArray(LogicalFile)
readByteArray(LogicalFile, long)
readLines(LogicalFile)
readLines(LogicalFile, String)
readString(LogicalFile)
readString(LogicalFile, String)
FileWriteFacade
createStream(LogicalFile, boolean append)
createWriter(LogicalFile)
createWriter(LogicalFile, boolean append)
createWriter(LogicalFile, String charsetName)
createWriter(LogicalFile, String charsetName, boolean append)
writeByteArray(LogicalFile, byte[])
writeByteArray(LogicalFile, byte[], boolean append)
writeString(LogicalFile, String)
writeString(LogicalFile, String, boolean append)
writeString(LogicalFile, String, String)
writeString(LogicalFile, String, String, boolean append)