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

  • SEARCH
  • Home
  • 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 7648197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:39:16+00:00 2026-05-31T10:39:16+00:00

I want to do input/output from a file. My requirement is not to use

  • 0

I want to do input/output from a file. My requirement is not to use any java stream classes.
I’ve done some research and most probably I will need to use a FileChannel.

However, how can I get a FileChannel object of a particular file without using the Java Stream classes?

Is it by using RandomAccessFile? By using RandomAccessFile class, do I fulfil the requirement of “not using any java stream classes”?

  • 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-05-31T10:39:18+00:00Added an answer on May 31, 2026 at 10:39 am

    There is no way to access a FileChannel without using either a InputStream, OutputStream, or a RandomAccessFile.

    And RandomAccessFile implements DataInput and DataOutput which provides an interface for reading bytes from a binary stream. So I believe even RandomAccessFile is a kind of stream class.

    Edit:

    I really don’t know with what context you are calling a class as a Stream class. RandomAccessFile can still be use in your case, as the reading and writing to stream is very much abstract to user. It shows how to read or write files in a non-sequentially manner.

    In general, we classify IO stream into following categories..

    • Byte Streams handle I/O of raw binary data.

    • Character Streams handle I/O of character data, automatically
      handling translation to and from the local character set.

    • Buffered Streams optimize input and output by reducing the number of
      calls to the native API.

    • Scanning and Formatting allows a program to read and write formatted
      text.

    • I/O from the Command Line describes the Standard Streams and the
      Console object.

    • Data Streams handle binary I/O of primitive data type and String
      values.

    • Object Streams handle binary I/O of objects.

    However, RandomAccessFile doesn’t belong to any of the above categories.It comes under I/O mechanism introduced in the JDK 7 release(NIO). It will come under Channel I/O and not Stream I/O. So, use RandomAccessFile.

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

Sidebar

Related Questions

i want to output some text in an label <input type=text size=20 maxlength=20 name=pizza1
I have an input stream, and I want to map to output lines. For
I want to filter records from given file based on some criteria,i want my
I am trying to use ASIO (Audio Stream Input/Output). I downloaded SDK, but because
Possible Duplicate: Character reading from file in Python I want to strip a input
I want to input a string or number from the keyboard and then display
I have a codeigniter webform, I want to input city/state details from the user,
I'm looking at how to do file input and output in Python. I've written
I want to read a long number from file then increment it and write
I want to create and return a zip file from my server using JaxRS.

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.