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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:36:05+00:00 2026-06-12T06:36:05+00:00

I am trying to create a sample which is getting InputStream in the form

  • 0

I am trying to create a sample which is getting InputStream in the form of SocketInputStream. It is not supported reset() and mark(). Now once I process this input stream I can process it again for other operation because it get closed, reached at eof.
Like I want to use this process for InputStream which is allowing reset() and markSupported().

How can I deal with InputStream in such situation.

  • 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-12T06:36:07+00:00Added an answer on June 12, 2026 at 6:36 am

    Obviously, by default SocketInputStream does not support mark() and reset(). A network stream is not something that you can reposition. There is nothing that is storing the bytes that have been already read so the stream can never go back.

    That said, you could extend SocketInputStream and provide that functionality. You would need to override the SocketInputStream.read(byte b[], int off, int length) method and store information in a ByteArrayOutputStream or some other running byte[]. Whenever the mark is repositioned, you would need to read from the byte[] only issuing a super.read(...) if you are at the end of your internal array.

    It’s a good bit of work to get right however and you are going to have to be very careful about memory here.

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

Sidebar

Related Questions

I am trying to create a simple GUI form which has only 2 elements
I'm trying to create a simple form with two different submit buttons: one which
I'm trying to create a simple function which returns me a date with a
I'm trying to create a simple profile tab which includes a gravatar using Devise,
I'm trying to create a simple web bot which will access a certain page,
I have been trying to create a simple program with Python which uses OpenCV
I am trying to create a very simple antlr grammar file which should parse
I've been trying very very hard to create a simple simple iOS app which
I've got a simple REST based service for which I am trying to create
I am trying to create sample gallery before filling real data. float xAxis =

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.