diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java index 59d79724b..9aff6a271 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java @@ -168,7 +168,7 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler { while (input.read(inBuffer) > 0) { inBuffer.flip(); output.write(inBuffer); - inBuffer.rewind(); + inBuffer.clear(); } } catch (IOException e) { throw new ODataRuntimeException("Error on reading request content", e); diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java index 7768783b6..d6929860f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java @@ -71,6 +71,7 @@ public class ChannelSerializerResult implements SerializerResult { if(r <= dest.remaining()) { dest.put(buffer); } else { + r = dest.remaining(); byte[] buf = new byte[dest.remaining()]; buffer.get(buf); dest.put(buf);