如何读取文件a.txt中第10个字节?
Posted constxiong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何读取文件a.txt中第10个字节?相关的知识,希望对你有一定的参考价值。
FileInputStream in = new FileInputStream("a.txt");
in.skip(9);//skip(long n) 方法,调过文件 n 个字节数
int b = in.read();
- Java 自学指南
- Java 面试题汇总PC端浏览【点这里】
- Java知识图谱
- Java 面试题汇总小程序浏览,扫二维码
所有资源资源汇总于公众号
!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6IjMwMzItMTU3MzE4NDY3MTA3MCIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiJGIn0seyJjaGFyIjoiaSJ9LHsiY2hhciI6ImwifSx7ImNoYXIiOiJlIn0seyJjaGFyIjoiSSJ9LHsiY2hhciI6Im4ifSx7ImNoYXIiOiJwIn0seyJjaGFyIjoidSJ9LHsiY2hhciI6InQifSx7ImNoYXIiOiJTIn0seyJjaGFyIjoidCJ9LHsiY2hhciI6InIifSx7ImNoYXIiOiJlIn0seyJjaGFyIjoiYSJ9LHsiY2hhciI6Im0ifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoiaSJ9LHsiY2hhciI6Im4ifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoiPSJ9LHsiY2hhciI6IiAifSx7ImNoYXIiOiJuIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6IncifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoiRiJ9LHsiY2hhciI6ImkifSx7ImNoYXIiOiJsIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6IkkifSx7ImNoYXIiOiJuIn0se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x7ImNoYXIiOiIgIn0seyJjaGFyIjoi5pa5In0seyJjaGFyIjoi5rOVIn0seyJjaGFyIjoiLCJ9LHsiY2hhciI6IuiwgyJ9LHsiY2hhciI6Iui/hyJ9LHsiY2hhciI6IuaWhyJ9LHsiY2hhciI6IuS7tiJ9LHsiY2hhciI6IiAifSx7ImNoYXIiOiJuIn0seyJjaGFyIjoiICJ9LHsiY2hhciI6IuS4qiJ9LHsiY2hhciI6IuWtlyJ9LHsiY2hhciI6IuiKgiJ9LHsiY2hhciI6IuaVsCJ9XSwiaXNSaWNoVGV4dCI6dHJ1ZSwia2VlcExpbmVCcmVhayI6dHJ1ZX19LHsiYmxvY2tJZCI6IjE5MzAtMTU3MzE4NDY3MTA3MCIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiJpIn0seyJjaGFyIjoibiJ9LHsiY2hhciI6InQifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoiYyJ9LHsiY2hhciI6IiAifSx7ImNoYXIiOiI9In0seyJjaGFyIjoiICJ9LHsiY2hhciI6ImkifSx7ImNoYXIiOiJuIn0seyJjaGFyIjoiLiJ9LHsiY2hhciI6InIifSx7ImNoYXIiOiJlIn0seyJjaGFyIjoiYSJ9LHsiY2hhciI6ImQifSx7ImNoYXIiOiIoIn0seyJjaGFyIjoiKSJ9LHsiY2hhciI6IjsifV0sImlzUmljaFRleHQiOnRydWUsImtlZXBMaW5lQnJlYWsiOnRydWV9fV0=-->
以上是关于如何读取文件a.txt中第10个字节?的主要内容,如果未能解决你的问题,请参考以下文章