Fixed NETTY-320 ReplayingDecoderBuffer.toByteBuffer(int, int) throws java.lang.IndexOutOfBoundsException

* Added missing checkIndex() call
This commit is contained in:
Trustin Lee 2010-06-01 09:19:19 +00:00
parent a55a1c6e72
commit 3a92fb8a9e

View File

@ -15,10 +15,6 @@
*/
package org.jboss.netty.handler.codec.replay;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.buffer.ChannelBufferIndexFinder;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -28,6 +24,10 @@ import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import java.nio.charset.Charset;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.buffer.ChannelBufferIndexFinder;
/**
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
@ -551,6 +551,7 @@ class ReplayingDecoderBuffer implements ChannelBuffer {
}
public ByteBuffer toByteBuffer(int index, int length) {
checkIndex(index, length);
return buffer.toByteBuffer(index, length);
}