Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9013439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:16:00+00:00 2026-06-16T03:16:00+00:00

I am new in java and now learning the File io . but i

  • 0

I am new in java and now learning the File io . but i am very confused about the io as there are many objects to deal with it (FileReader, FileWriter, BufferedReader, BufferedWriter, FileInputStream, FileOutputStream … and may be there are more).

I want to know that what is the most efficient process for File io(What should i use ?).i don’t want any encoding. i want just processing text files.
Any simple example code will be greatly helpful.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:16:02+00:00Added an answer on June 16, 2026 at 3:16 am

    First important point to understand and remember:

    • Stream: sequence of bytes.

    • Reader/Writer: sequence of characters (Strings)

    Don’t mix them, don’t translate for one to another if not necessary, and always specify the encoding.

    Some quick recipes:

    To read a file as a sequence of bytes (binary reading).

    new FileInputStream(File f);
    

    The same adding buffering:

    new BufferedInputStream(new FileInputStream(File f));
    

    To read a file as a sequence of characters (text reading).

    new FileReader(File f); // ugly, dangerous, does not let us specify the encoding
    
    new InputStreamReader(new FileInputStream(File f),Charset charset);  // good, though verbose
    

    To add line-oriented buffering (to read lines of text)

    new BufferedReader(  ... someReader ... );  
    

    To output/write is practically the same (output/writer)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to programming. I am learning Java now, there is something I
I'm pretty new to java and really enjoying learning about it. I have made
I'm learning about deadlocks in Java, and there's this sample code from Sun's official
We're learning file input and output in my programming class right now, but I
I have been slowing learning and building my first android app. I'm VERY new
I am new at Java. I am learning. I am trying to do the
I'm implementing a new machine learning algorithm in Java that extracts a prototype datastructure
I'm fairly new to java. I'm reading up on it and learning as I
I am learning java with BlueJ, and recently I was given a .jar file
I am learning java and started with classes and I am now having some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.