banker's recent timeline updates
java 可以像 C 一样 readline 么?
randomaccessfile readline 再 getbytes(iso8859-1)这种乱码可以还原么?
May 10, 2017
banker

banker

V2EX member #226677, joined on 2017-04-19 00:40:25 +08:00
Per banker's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
banker's recent replies
@hst001 刚买房,唉
Apr 1, 2019
Replied to a topic by 5ispy 程序员 为什么要用毫秒值的形式存储日期时间?
为什么不呢?毫秒可以转换为秒 /分钟 /小时 /天,反之则转不回来
毫秒有一定的区分度,1 秒钟可以有几万笔交易
May 11, 2017
Replied to a topic by banker 程序员 Java 可以像 C 一样 readline 么?
看起来比较简单的做法就是 RandomAccessFile 的 readLine,再 getBytes("ISO8859-1")了,就是这个 readLine 是一个字节一个字节读的估计效率不会很高,如果要高效估计就要改写几个 io 库的几个类了
@Arthur2e5 就我所知,换行符都是\n 或者\r\n
@mosliu 文件编码有约定,但是有的文件中存在乱码,比如在 UTF-8 编码中出现 0x88 这种,按照 utf-8 读文件,再 getBytes("utf-8")得到的字节数组就和文件中存储的不一致了
May 10, 2017
Replied to a topic by banker 程序员 Java 可以像 C 一样 readline 么?
@mosliu 这个对文件中的乱码没法还原
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4698 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 03:57 · PVG 11:57 · LAX 20:57 · JFK 23:57
♥ Do have faith in what you're doing.