我的代码从http连接读取并将数据放入ByteArrayOutputStream。从http协议读取并放入字符串数组(Android/Java)
http数据内容的第一行是更新日期/时间,然后是其他数据。
2012-03-02 03:06:34
text1
text2
text3
我发现这个:从HTTP URL收到
数据举例
InputStream content = response.getEntity().getContent();
byte[] buffer = new byte[1024];
int numRead = 0;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while((numRead=content.read(buffer))!=-1){
baos.write(buffer, 0, numRead);
}
content.close();
String result = new String(baos.toByteArray());
如何使用的第一行(“2012-03-02 3时06分34秒“)然后其他人排?
我会想使用一个字符串数组,并与
for (int i=1;i
拿到第一排与BAOS [0]和其他人如何可以吗? 谢谢。 我的英语非常难看:-o
2012-03-01
Cuarcuiu