T - data typepublic class FileWritableDataSource<T> extends Object implements WritableDataSource<T>
WritableDataSource based on file.| Constructor and Description |
|---|
FileWritableDataSource(File file,
Converter<T,String> configEncoder) |
FileWritableDataSource(File file,
Converter<T,String> configEncoder,
Charset charset) |
FileWritableDataSource(String filePath,
Converter<T,String> configEncoder) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the data source.
|
void |
write(T value)
Write the
value to the data source. |
public FileWritableDataSource(String filePath, Converter<T,String> configEncoder)
public void write(T value) throws Exception
WritableDataSourcevalue to the data source.write in interface WritableDataSource<T>value - value to writeException - IO or other error occurspublic void close()
throws Exception
WritableDataSourceclose in interface WritableDataSource<T>Exception - IO or other error occursCopyright © 2022 Alibaba Group. All rights reserved.