【发布时间】:2019-12-10 21:30:33
【问题描述】:
我有存储桶XLS 文件,我必须提取文件并读取流上的数据并处理数据。我使用CSV 文件,这是我的代码:
try (ReadChannel reader = storage.reader(bucketName, fileName)) {
ByteBuffer bytes = ByteBuffer.allocate(BUFFER_SIZE);
while (reader.read(bytes) > 0) {
bytes.flip();
// outChannel.write(bytes);
set(new String(bytes.array(), "UTF-8"), fileName);
bytes.clear();
}
}
【问题讨论】:
-
从云存储中获取 xls 文件的步骤应与获取 csv 文件相同。当您尝试获取 xls 文件时遇到什么问题?
标签: java spring-boot google-cloud-platform