Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /File Handling /Examples /FileInputStreamExample2.java
Download data/train/akash-coded/FSD_Java/Lesson-3/File Handling/Examples/FileInputStreamExample2.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/File%20Handling/Examples/FileInputStreamExample2.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/File Handling/Examples/FileInputStreamExample2.java'
-
curl -L -o FileInputStreamExample2.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/File%20Handling/Examples/FileInputStreamExample2.java
402 Bytes
| import java.io.FileInputStream; | |
| public class FileInputStreamExample2 { | |
| public static void main(String args[]) { | |
| try (FileInputStream fin = new FileInputStream("testout2.txt")) { | |
| int i = 0; | |
| while ((i = fin.read()) != -1) { | |
| System.out.print((char) i); | |
| } | |
| } catch (Exception e) { | |
| System.out.println(e); | |
| } | |
| } | |
| } | |