Tabnine Logo
BufferedReader.skip
Code IndexAdd Tabnine to your IDE (free)

How to use
skip
method
in
java.io.BufferedReader

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

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: pmd/pmd

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

BufferedReader reader = new BufferedReader(new InputStreamReader(input, charsetName), bufferSize);
if (bomCharset != null && bomCharset.offset) // creating the buffered reader ignores the input pos, so must skip here
  reader.skip(1);
try {
  doc = parser.parseInput(reader, baseUri);
origin: ahmetaa/zemberek-nlp

/**
 * Returns an Iterator that loads [blocksize] lines in each iteration. It starts loading from
 * [charIndex] value of the content.
 */
Iterator<TextChunk> iteratorFromCharIndex(long charIndex) {
 try {
  BufferedReader reader = Files.newBufferedReader(path, charset);
  long k = reader.skip(charIndex);
  if (k != charIndex) {
   throw new IllegalStateException("Cannot skip " + charIndex + " skip returned " + k);
  }
  if (charIndex != 0) { // skip first line
   reader.readLine();
  }
  return new TextIterator(reader);
 } catch (IOException e) {
  e.printStackTrace();
  throw new RuntimeException(e);
 }
}
origin: com.github.akurilov/java-commons

/**
 * Skips characters instead of lines
 */
@Override
public long skip(final long count)
throws IOException {
  return reader.skip(count);
}

origin: com.atlassian.jira/jira-core

public long skip(final long n) throws IOException
{
  return delegate.skip(n);
}
origin: org.jwall/org.jwall.web.audit

@Override
public void skip(Long bytes) {
  try {
    Long skipped = reader.skip( bytes );
    bytesRead += skipped;
  } catch (Exception e) {
    e.printStackTrace();
  }
}
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: org.wso2.carbon.touchpoint/org.wso2.carbon.extensions.touchpoint

  private void readOffStream(InputStream inputStream) {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.defaultCharset()))) {
      while (reader.skip(Long.MAX_VALUE) == Long.MAX_VALUE) {
        // do nothing
      }
    } catch (IOException e) {
      // ignore
    }
  }
}
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.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: com.caucho/resin

@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: 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: baratine/baratine

@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: 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: 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: 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: 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: net.sourceforge.pmd/pmd-core

private void tryToDeleteFromFile(final RegionByOffset regionByOffset) throws IOException {
  writeUntilOffsetReached(regionByOffset.getOffset());
  reader.skip(regionByOffset.getLength());
  currentPosition = regionByOffset.getOffsetAfterEnding();
}
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>
    Creates a buffering character-input stream that uses an input buffer of the specified size.
  • 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 characters into a portion of an array. This method implements the general contract of the corr
  • lines
  • ready
    Tells whether this stream is ready to be read. A buffered character stream is ready if the buffer is
  • reset
    Resets the stream to the most recent mark.
  • mark
    Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the
  • markSupported
    Tells whether this stream supports the mark() operation, which it does.
  • checkNotClosed
  • chompNewline
    Peeks at the next input character, refilling the buffer if necessary. If this character is a newline
  • fillBuf
    Populates the buffer with data. It is an error to call this method when the buffer still contains da
  • chompNewline,
  • fillBuf,
  • isClosed,
  • maybeSwallowLF,
  • readChar,
  • fill,
  • ensureOpen,
  • read1

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Table (org.hibernate.mapping)
    A relational table
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now