Use gathering writes in CompositeChannelBuffer if jdk >= 7. See #267
This commit is contained in:
parent
cbb8654193
commit
c5ab2f5dad
@ -26,6 +26,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.jboss.netty.util.internal.DetectionUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A virtual buffer which shows multiple buffers as a single merged buffer. It
|
* A virtual buffer which shows multiple buffers as a single merged buffer. It
|
||||||
@ -275,6 +277,9 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer {
|
|||||||
|
|
||||||
public int getBytes(int index, GatheringByteChannel out, int length)
|
public int getBytes(int index, GatheringByteChannel out, int length)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
if (DetectionUtil.javaVersion() >= 7) {
|
||||||
|
return (int) out.write(toByteBuffers(index, length));
|
||||||
|
}
|
||||||
// XXX Gathering write is not supported because of a known issue.
|
// XXX Gathering write is not supported because of a known issue.
|
||||||
// See http://bugs.sun.com/view_bug.do?bug_id=6210541
|
// See http://bugs.sun.com/view_bug.do?bug_id=6210541
|
||||||
// This issue appeared in 2004 and is still unresolved!?
|
// This issue appeared in 2004 and is still unresolved!?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user