Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
try{
Path pt=new Path("hdfs:/jp./myserver.com:9000/user/someuser/out/somepath");
FileSystem fs = FileSystem.get(new Configuration());
BufferedWriter br=new BufferedWriter(new OutputStreamWriter(fs.create(pt,true)));
// TO append data to a file, use fs.append(Path f)
String line;
line="This is BINARY content fo JPEG in String form";
System.out.println(line);
br.write(line);
br.close();
}catch(Exception e){
System.out.println("File not found");
}