Index: ../../incubator-johnzon/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ../../incubator-johnzon/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java	(revision b7948d5174018ddf04c95a4abd8107720d20155e)
+++ ../../incubator-johnzon/johnzon-core/src/main/java/org/apache/johnzon/core/JsonStreamParserImpl.java	(revision )
@@ -42,8 +42,7 @@
     //-1 would cause a re-read of the first character in the buffer (which is at zero index)
     private int bufferPos = Integer.MIN_VALUE;
 
-    //available character in the buffer
-    //normally this is buffer.length, except for the last buffer page it might be <= buffer.length
+    //available character in the buffer. It might be <= "buffer.length".
     private int availableCharsInBuffer;
 
     //start and end position of values in the buffer
@@ -249,7 +248,7 @@
     //refill is neccessary copy the already readed value part into the value buffer
     private char readNextChar() {
 
-        if ((buffer.length - bufferPos) <= 1) {
+        if ((availableCharsInBuffer - bufferPos) <= 1) {
             //fillbuffer
 
             //copy content from old buffer to valuebuffer
@@ -279,12 +278,12 @@
             bufferPos = 0;
             //end fillbuffer
         } else {
-            
+
             //prevent "bufferoverflow
             if(bufferPos + 1 >= availableCharsInBuffer) {
                 return EOF;
             }
-            
+
             bufferPos++;
         }
 
\ No newline at end of file
