Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /File Handling /Examples /FileOutputStreamExample2.java
Download data/train/akash-coded/FSD_Java/Lesson-3/File Handling/Examples/FileOutputStreamExample2.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 471 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/File%20Handling/Examples/FileOutputStreamExample2.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/File Handling/Examples/FileOutputStreamExample2.java'
-
curl -L -o FileOutputStreamExample2.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/File%20Handling/Examples/FileOutputStreamExample2.java
471 Bytes
| import java.io.FileOutputStream; | |
| public class FileOutputStreamExample2 { | |
| public static void main(String args[]) { | |
| try (FileOutputStream fout = new FileOutputStream("testout2.txt")) { | |
| String s = "Enjoy the session!"; | |
| byte b[] = s.getBytes();// converting string into byte array | |
| fout.write(b); | |
| System.out.println("success..."); | |
| } catch (Exception e) { | |
| System.out.println(e); | |
| } | |
| } | |
| } |