diff --git a/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java b/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java index 7181545..69f3dd3 100644 --- a/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java +++ b/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java @@ -23,6 +23,7 @@ */ package org.jmxtrans.agent; +import java.nio.Buffer; import org.jmxtrans.agent.util.CachingReference; import org.jmxtrans.agent.util.ConfigurationUtils; import org.jmxtrans.agent.util.StringUtils2; @@ -228,7 +229,7 @@ public synchronized boolean flush() { } // empty buffer // send and reset the buffer - sendBuffer.flip(); + ((Buffer)sendBuffer).flip(); final int nbSentBytes = channel.send(sendBuffer, address); sendBuffer.limit(sendBuffer.capacity()); sendBuffer.rewind();