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 )
@@ -249,7 +249,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
@@ -266,8 +266,10 @@
             }
 
             try {
+                do {
-                availableCharsInBuffer = in.read(buffer, 0, buffer.length);
+                    availableCharsInBuffer = in.read(buffer, 0, buffer.length);
-                if (availableCharsInBuffer <= 0) {
+                } while (availableCharsInBuffer == 0);
+                if (availableCharsInBuffer == -1) {
                     return EOF;
                 }
 
\ No newline at end of file
