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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:55:54+00:00 2026-05-16T19:55:54+00:00

I wonder now, what is the difference between the two methods: DataInputStream.skipBytes and DataInputStream.skip

  • 0

I wonder now, what is the difference between the two methods:

DataInputStream.skipBytes and DataInputStream.skip.

I am aware of the fact that skip must come from InputStream and skipBytes from DataInput, but still, is there any difference. You know, when using streams in J2ME, things get pretty tricky so I need to know!

Would the Input/DataInput Streams returned from the FileConnection in JSR-75 be any different in handling than any other such streams?

Thanks!

  • 1 1 Answer
  • 1 View
  • 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-16T19:55:55+00:00Added an answer on May 16, 2026 at 7:55 pm

    from DataInputStream :

    public final int skipBytes(int n) throws IOException {
        int total = 0;
        int cur = 0;
    
        while ((total<n) && ((cur = (int) in.skip(n-total)) > 0)) {
            total += cur;
        }
    
        return total;
        }
    

    as you can see from the code, skipBytes uses skip (InputStream.skip)

    the only thing that i can say is that if data in your wrapped inputStream (InputStream inside DataInputStream)changes by another thread, then the result of skipBytes and skip may be different. but if your application just working with single thread then skipBytes and skip are the same.

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

Sidebar

Related Questions

I have such model now: receipt contains components. component contain product. The difference between
I understand the differences between the two from the docs. uuid1() : Generate a
What's the difference between MySQLDialect and MySQLInnoDBDialect? I've used MySQLDialect ever since, now I
I have made two pages and now I wonder if I can DRY them.
I am using Xcode 4.2 now. I wonder if there is a way to
I've been using debug() more often now, but sometimes I wonder which functions have
I wonder about that can I write native SQL to add or delete operations
I wonder, using Eclipse's PyDev plugin , how come documentation does not always show
Every now and then I find web applications that have some sort of article
Regular distributions of Xcode are now available exclusively from the OS X App Store

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.