Commits

Sebastian Bub committed 1eeee21

bugfix in for reading in simulation to return 2

Comments (0)

Files changed (1)

src/main/java/de/derbub/rpigpio/gpio/files/FileReaderSimulation.java

     }
 
     @Override
-    public int read(char[] chars, int i, int i1) throws IOException {
+    public int read(char[] chars, int offset, int length) throws IOException {
         int retVal = -1;
         if (!alreadyReadOnce) {
             alreadyReadOnce = true;
-            retVal = 2;
-            char[] noStateChar = Integer.toString(ConfiguredGpio.NO_STATE).toCharArray();
-            System.arraycopy(noStateChar, 0, chars, i, noStateChar.length);
+            retVal = 1;
+            char[] noStateChar = Integer.toString(2).toCharArray();
+            System.arraycopy(noStateChar, 0, chars, offset, noStateChar.length);
         }
         return retVal;
     }