Solved

what is the use of skip() in the BufferedReader class?

Posted on 2009-07-16
3
235 Views
Last Modified: 2013-11-23
H i want to know the usage of the skip() in the BufferedReader class?
0
Comment
Question by:haneefnb
  • 2
3 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 24870977
Hello haneefnb

It allows you to skip over a certain number of characters specified as a long value passed like skip(100) will skip over 100 characters so that when you call read() next you get the 101st character instead of the 1st from where you currently are in the buffered reader.

Hopefully that makes sense.

Regards,

mwvisa1
0
 

Author Comment

by:haneefnb
ID: 24871017
thank u mwvisa1

could u please give me a example for this
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 24871160

BufferedReader br = new BufferedReader(new FileReader("anyfile.txt"));

br.skip(100);

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now