再问一个关于字符处理的问题。

xxdino 2001-06-04 07:24:00
我从一个二进制流中某个地方取出很长一串byte[],但是不知道这个byte[]的长度,而且还是以byte[]的形式储存起来,我怎么做呢?不能用本地文件来存储。byte[]可能随时增加长度而不伤害数据的吗?很急。
...全文
57 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
skyyoung 2001-06-04
  • 打赏
  • 举报
回复
byte的长度用buff.length就可以得到。

buff = new byte[1024]
in.read(buff);

System.arraycopy(Object src, int src_position, Object dst, int dst_position, int length)
Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.
xxdino 2001-06-04
  • 打赏
  • 举报
回复
帮帮我啊!
xxdino 2001-06-04
  • 打赏
  • 举报
回复
我的意思是连 buff有多场都不知道啊,可能要随时增加的

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧