All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.report.rules.pmd.CheckSkipResult.html Maven / Gradle / Ivy

Go to download

Sanity4J was created to simplify running multiple static code analysis tools on the Java projects. It provides a single entry point to run all the selected tools and produce a consolidated report, which presents all findings in an easily accessible manner.

The newest version!


CheckSkipResult

CheckSkipResult

The skip() method may skip a smaller number of bytes than requested. Check the returned value to find out if it was the case or not. This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.basic.CheckSkipResultRule

Example(s):

        
public class Foo {

   private FileInputStream _s = new FileInputStream("file");

   public void skip(int n) throws IOException {
      _s.skip(n); // You are not sure that exactly n bytes are skipped
   }

   public void skipExactly(int n) throws IOException {
      while (n != 0) {
         long skipped = _s.skip(n);
         if (skipped == 0)
            throw new EOFException();
         n -= skipped;
      }
   }
        




© 2015 - 2025 Weber Informatics LLC | Privacy Policy