java - 如何把一个集合,转换成固定格式的文件流 ?
黄舟
黄舟 2017-04-18 10:02:47
0
4
548

有一个集合 List<User> 里面有200条数据 ,
我想把它转换成 .csv格式的流 ,
通过 httpPost 发送出去 ,
直接把list转成流和读取 .csv 的流有什么区别 ?

下面是请求参数类型 :

这个格式file的.如果我的值是 流应该也没有问题吧 ?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
黄舟

Others know, but I have successfully passed this as a parameter through the java io stream.

Ty80

How to directly read the list stream across languages?

刘奇

Looking at the description of the question, the other party should provide an http service. The subject wants to upload files to the corresponding service through HttpClient.
If my understanding is correct.
Then the poster must convert List<> into the corresponding file format .csv.
If you don’t do this, the other party can receive your byte stream, but it will not be able to parse it, because the other party is in CSV format. F.

In a word, the business protocols of the client and the server are inconsistent. Neither side knew what the other said.

左手右手慢动作

.csv contains the file header information and the unique file content of the .csv file, just like a defined protocol

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!