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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:32:26+00:00 2026-06-11T23:32:26+00:00

In my logger code, I am using FileInputStream for reading the log files. The

  • 0

In my logger code, I am using FileInputStream for reading the log files. The number of bytes in the file that were last read from the log file ‘byteOffset’ is stored. Whenever the reader has to read the log it would do FileInputStream.skip(byteOffset) and reads from there. In this context, I found the statement below from the InputStream.skip() documentation.

Skips over and discards n bytes of data from this input stream. The
skip method may, for a variety of reasons, end up skipping over some
smaller number of bytes
, possibly 0. This may result from any of a
number of conditions; reaching end of file before n bytes have been
skipped is only one possibility.

Apart from what is mentioned in the documentation, for what other reasons will the actual skipped data vary from the input? I just want to be sure what all cases I need to be prepared for in my log reader code.

  • 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-11T23:32:27+00:00Added an answer on June 11, 2026 at 11:32 pm

    It depends on the implementation. Maybe it’s a buffered stream, and it only has 100 bytes read from the backing stream, and retrieving more more bytes would take more time.

    (I don’t think that was a good decision to put that part in the InputStream specification, but it’s impossible to change now.)

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

Sidebar

Related Questions

I redirected Java Logger to log in file using following code: Handler handler =
i'm trying to read long types from a text file with using readLine() method
try { // Code } catch (Exception ex) { Logger.Log(Message, ex); throw; } In
I am using a SQLite database to store values from a data logger. The
I'm having a problem using nested partials with dynamic form builder code (from the
I am using NLog and I want to log to RichTextBox and File at
I am using Apache POI to read xlsx file, it works well. I have
I'm using a code below to upload file (tens of MB) in streaming mode.
I am using Apache poi 3.8 for reading xls file, but i got exception:
I am using this code to validate logged in / authenticated users in my

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.