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 7186307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:36:14+00:00 2026-05-28T18:36:14+00:00

Good afternoon all. I am aware that if we close() an java.io.OutputStream , it

  • 0

Good afternoon all. I am aware that if we close() an java.io.OutputStream, it may throw an IOException when there are hard disk errors.

As for java.io.InputStream, Javamex states that:

A normal closure of a network socket actually involves a closure request (TCP/IP FIN packet) being sent over the connection and waiting for the other end to acknowledge this closure request. (In fact, the other end of the connection then in turn sends a closure request, which the closing end acknowledges.) So in the case of a socket input stream, a closure operation actually involves sending traffic over the connection and the closure can thus fail with an error.

Now I was wondering exactly under what circumstances will a java.io.InputStream (or sub class) for a local file (network access not needed) ever throw an exception when we call close() ?

  • 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-28T18:36:15+00:00Added an answer on May 28, 2026 at 6:36 pm

    Here’s one situation:

    • Another part of the application has mistakenly closed the underlying file descriptor associated with the InputStream. When the Java runtime calls the system close() function, it may get an EBADF error indicating that the file handle is invalid.

    The above situation probably indicates a serious bug somewhere else in the application.

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

Sidebar

Related Questions

Good afternoon all, I am building a function that takes a string as input,
Good afternoon all, I was wondering what's the reason that public class test<T> {
Good afternoon all, I'm using a java.lang.StringBuilder to store some characters. I have no
Good Afternoon All, I have a wizard control that contains 20 textboxes for part
Good Afternoon All, I have written an SSIS 2005 package that contains a conditional
afternoon all. Iv'e come across some mathematical problems that im not too good at.
Good afternoon, I wish to have a script that will look for all files
Good afternoon all. I have a page that displays data in a gridview based
Good afternoon all, I've got an issue with a BizTalk orchestration that's really odd.
Good afternoon, Many of you may already know that it is possible, for instance,

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.