BufferedReader.skip
Code IndexAdd Codota to your IDE (free)

Best code snippets using java.io.BufferedReader.skip(Showing top 15 results out of 315)

  • Common ways to obtain BufferedReader
private void myMethod () {
BufferedReader b =
  • InputStream in;new BufferedReader(new InputStreamReader(in))
  • Reader in;new BufferedReader(in)
  • File file;new BufferedReader(new FileReader(file))
  • AI code suggestions by Codota
}
origin: apache/storm

private TextFileReader(FileSystem fs, Path file, Map<String, Object> conf, TextFileReader.Offset startOffset)
    throws IOException {
 super(fs, file);
 offset = startOffset;
 FSDataInputStream in = fs.open(file);
 String charSet = (conf==null || !conf.containsKey(CHARSET) ) ? "UTF-8" : conf.get(CHARSET).toString();
 int buffSz = (conf==null || !conf.containsKey(BUFFER_SIZE) ) ? DEFAULT_BUFF_SIZE : Integer.parseInt( conf.get(BUFFER_SIZE).toString() );
 reader = new BufferedReader(new InputStreamReader(in, charSet), buffSz);
 if(offset.charOffset >0) {
  reader.skip(offset.charOffset);
 }
}
origin: pmd/pmd

private void tryToReplaceInFile(final RegionByOffset regionByOffset, final String textToReplace) throws IOException {
  writeUntilOffsetReached(regionByOffset.getOffset());
  reader.skip(regionByOffset.getLength());
  currentPosition = regionByOffset.getOffsetAfterEnding();
  writer.write(textToReplace);
}
origin: stackoverflow.com

 BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));
// read what you want here
reader.skip(20);
// read the rest of the file after skipping
origin: stackoverflow.com

 InputStream is = new FileInputStream(filePath);
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"UTF-8"));
reader.skip(n); // chars to skip
// .. and here you can start reading
origin: org.biojava/biojava-core

/**
 *  Load the sequence
 * @return
 */
private boolean init() throws IOException, CompoundNotFoundException {
  BufferedReader br = new BufferedReader(new FileReader(file));
  br.skip(sequenceStartIndex);
  String sequence = sequenceParser.getSequence(br, sequenceLength);
  setContents(sequence);
  br.close(); // close file to prevent too many being open
  return true;
}
origin: Esri/spatial-framework-for-hadoop

private void commonInit(Path filePath, Configuration conf) throws IOException {
  readerPosition = start;
  FileSystem fs = filePath.getFileSystem(conf);
  inputReader = new BufferedReader(new InputStreamReader(fs.open(filePath)));
  if (start != 0) {
    // split starts inside the json
    inputReader.skip(start);
    moveToRecordStart();
  }
}
origin: com.caucho/quercus

@Override
public long skip(long n) throws IOException
{
 BufferedReader reader = _bufferedReader;
 
 if (reader != null)
  return reader.skip(n);
 
 long count = 0;
 for (; count < n && _rs.readChar() >= 0; count++) {
 }
 return count;
}
origin: apache/jackrabbit

private Tail(File file, String grep) throws IOException {
  this.grep = grep;
  this.reader = new BufferedReader(new InputStreamReader(
      new FileInputStream(file)));
  while (reader.skip(Integer.MAX_VALUE) > 0) {
    // skip more, until end of file
  }
}
origin: com.atlassian.jira/jira-core

public long skip(final long n) throws IOException
{
  return delegate.skip(n);
}
origin: pmd/pmd

private void tryToDeleteFromFile(final RegionByOffset regionByOffset) throws IOException {
  writeUntilOffsetReached(regionByOffset.getOffset());
  reader.skip(regionByOffset.getLength());
  currentPosition = regionByOffset.getOffsetAfterEnding();
}
origin: org.apache.storm/storm-hdfs

private TextFileReader(FileSystem fs, Path file, Map conf, TextFileReader.Offset startOffset)
    throws IOException {
 super(fs, file);
 offset = startOffset;
 FSDataInputStream in = fs.open(file);
 String charSet = (conf==null || !conf.containsKey(CHARSET) ) ? "UTF-8" : conf.get(CHARSET).toString();
 int buffSz = (conf==null || !conf.containsKey(BUFFER_SIZE) ) ? DEFAULT_BUFF_SIZE : Integer.parseInt( conf.get(BUFFER_SIZE).toString() );
 reader = new BufferedReader(new InputStreamReader(in, charSet), buffSz);
 if(offset.charOffset >0) {
  reader.skip(offset.charOffset);
 }
}
origin: net.sourceforge.pmd/pmd-core

private void tryToDeleteFromFile(final RegionByOffset regionByOffset) throws IOException {
  writeUntilOffsetReached(regionByOffset.getOffset());
  reader.skip(regionByOffset.getLength());
  currentPosition = regionByOffset.getOffsetAfterEnding();
}
origin: biojava/biojava

/**
 *  Load the sequence
 * @return
 */
private boolean init() throws IOException, CompoundNotFoundException {
  BufferedReader br = new BufferedReader(new FileReader(file));
  br.skip(sequenceStartIndex);
  String sequence = sequenceParser.getSequence(br, sequenceLength);
  setContents(sequence);
  br.close(); // close file to prevent too many being open
  return true;
}
origin: net.sourceforge.pmd/pmd-core

private void tryToReplaceInFile(final RegionByOffset regionByOffset, final String textToReplace) throws IOException {
  writeUntilOffsetReached(regionByOffset.getOffset());
  reader.skip(regionByOffset.getLength());
  currentPosition = regionByOffset.getOffsetAfterEnding();
  writer.write(textToReplace);
}
origin: org.apache.storm/storm-hdfs

private TextFileReader(FileSystem fs, Path file, Map conf, TextFileReader.Offset startOffset)
    throws IOException {
 super(fs, file);
 offset = startOffset;
 FSDataInputStream in = fs.open(file);
 String charSet = (conf==null || !conf.containsKey(CHARSET) ) ? "UTF-8" : conf.get(CHARSET).toString();
 int buffSz = (conf==null || !conf.containsKey(BUFFER_SIZE) ) ? DEFAULT_BUFF_SIZE : Integer.parseInt( conf.get(BUFFER_SIZE).toString() );
 reader = new BufferedReader(new InputStreamReader(in, charSet), buffSz);
 if(offset.charOffset >0) {
  reader.skip(offset.charOffset);
 }
}
java.ioBufferedReaderskip

Javadoc

Skips at most charCount chars in this stream. Subsequent calls to read will not return these chars unless reset is used.

Skipping characters may invalidate a mark if markLimitis surpassed.

Popular methods of BufferedReader

  • <init>
    Constructs a new BufferedReader, providing in with size characters of buffer.
  • readLine
    Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carr
  • close
    Closes this reader. This implementation closes the buffered source reader and releases the buffer. N
  • read
    Reads up to length characters from this reader and stores them at offset in the character array buff
  • ready
    Indicates whether this reader is ready to be read without blocking.
  • lines
  • reset
    Resets this reader's position to the last mark() location. Invocations of read() and skip() will occ
  • mark
    Sets a mark position in this reader. The parameter markLimitindicates how many characters can be rea
  • markSupported
    Indicates whether this reader supports the mark() and reset() methods. This implementation returns t
  • checkNotClosed
  • chompNewline
    Peeks at the next input character, refilling the buffer if necessary. If this character is a newline
  • fill
    Fills the input buffer, taking the mark into account if it is valid.
  • chompNewline,
  • fill,
  • fillBuf,
  • isClosed,
  • maybeSwallowLF,
  • readChar,
  • ensureOpen,
  • read1

Popular classes and methods

  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • BorderLayout (java.awt)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    This implementation uses bit groups of size 32 to keep track of when bits are set to true or false.
  • SortedMap (java.util)
    A Map that further provides a total ordering on its keys. The map is ordered according to the Compar
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JButton (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)