要求如下:
自行在本地文件系统生成一个大约一百多字节的文本文件,写一段程序(可以利用Java API或C API),读入这个文件,并将其第101-120字节的内容写入HDFS成为一个新文件。
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class ShengChen {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
File file=new File("/home/weiguohui/shengchen.txt");
if (!file.exists()) {
file.createNewFile();
}
byte[] bytes=new byte[130];
f