我有一个文件,可以是任何东西像ZIP,RAR,txt,CSV,文件等。我想创建一个ByteArrayInputStream从它。
我正在使用它通过FTPClient从Apache Commons Net上传一个文件到FTP。
有人知道怎么做吗?
例如:
String data = "hdfhdfhdfhd";
ByteArrayInputStream in = new ByteArrayInputStream(data.getBytes());
我的代码:
public static ByteArrayInputStream retrieveByteArrayInputStream(File file) {
ByteArrayInputStream in;
return in;
}
https://stackoverflow.com/questions/11223868
复制相似问题