Untitled

mail@pastecode.io avatar
unknown
java
3 years ago
776 B
0
Indexable
Never
    import java.io.*;
import java.lang.*;
    import java.nio.charset.StandardCharsets;

    public class Main {

        public static void main(String[] args) {
            InputStream in = null;
            try {
                in = new FileInputStream("in.txt");
                byte[] bytes = new byte[in.available()];
                bytes = in.readAllBytes();
                for(int i = 0; i < bytes.length / 2; i++) {
                    System.out.write(bytes[i]);
                }
            }
            catch (IOException ex) {

            }
            finally {
                try {
                    in.close();
                }
                catch (IOException ex) {

                }
            }
            System.out.flush();
        }
    }