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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:18:27+00:00 2026-05-26T05:18:27+00:00

Good night in my timezone. I am building an http bot, and when i

  • 0

Good night in my timezone.

I am building an http bot, and when i receive the response from the server i want to make two things.First is to print the body of the response and because i know that the body of the response is of the type TEXT/HTML the second thing that i make is to parse the response through a html parser(in this specific case NekoHtml).
Snippet of code :

    //Print the first call
    printResponse(urlConnection.getInputStream());
    document = new InputSource(urlConnection.getInputStream());
    parser.setDocument(document);

The problem is when i run the first line (printResponse) the second line will throw an exception.
Now the questions-> This happens because the InputStream can only be read one time ?every time that we read from the inputstream the bytes are cleaned?
How can we read more that one time the content from the inputstream ?

Thanks in advance

Best regards

  • 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-26T05:18:27+00:00Added an answer on May 26, 2026 at 5:18 am

    Read the response from the server into a byte array. You can then create a ByteArrayInputStream to repeatedly read the bytes.

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

Sidebar

Related Questions

Good morning, afternoon, evening or night (depending on your timezone). This is just a
good night: I want to mouse over .slide show the #panel , then click
Good night all, this is my first question. i got some problem when running
Good night, I have a method in which I need to select from an
Good morning, I work in a small shop (only two of us) and we
So, I'd like to be able to make a call x = MyClass.new('good morning',
Well, Maven is too good, when talking about speed. But I want something that
Is there a good way to check a form input using regex to make
Good night, I am currently working on a very simple lexical analiser for human
good night i have a doubt what reason this output doesn't work [{var1:abc},{var2:abcd},{var3:abcde}] but

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.