| | |
| | | package org.springblade.mdm.utils; |
| | | |
| | | import org.junit.jupiter.api.Assertions; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Charsets; |
| | | |
| | | import java.io.*; |
| | |
| | | Charset charset = Charsets.charset(charsetName); |
| | | //System.out.println(charset); |
| | | } |
| | | |
| | | //@Test |
| | | public void testReadLineAt() throws IOException { |
| | | String file = "D:/a.txt"; |
| | | int lineIndex = 1; |
| | | FileInputStream fis = new FileInputStream(file); |
| | | |
| | | String expected = "第二行"; |
| | | String read = FileContentUtil.readLineAt(fis,lineIndex); |
| | | Assertions.assertEquals(expected,read); |
| | | |
| | | } |
| | | } |