mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
various refinements to network implementation
The main idea is to make DatagramChannel and *SocketChannel behave in a way that more closely matches the standard, e.g. allow binding sockets to addresses without necessarily listening on those addresses and accept null addresses where appropriate. It also avoids multiple redundant DNS lookups. This commit also implements CharBuffer and BindException, and adds the Readable interface.
This commit is contained in:
@ -54,14 +54,14 @@ class ArrayByteBuffer extends ByteBuffer {
|
||||
|
||||
public ByteBuffer put(ByteBuffer src) {
|
||||
int length = src.remaining();
|
||||
checkPut(position, length);
|
||||
checkPut(position, length, false);
|
||||
src.get(array, arrayOffset + position, length);
|
||||
position += length;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ByteBuffer put(byte[] src, int offset, int length) {
|
||||
checkPut(position, length);
|
||||
checkPut(position, length, false);
|
||||
|
||||
System.arraycopy(src, offset, array, arrayOffset + position, length);
|
||||
position += length;
|
||||
@ -70,7 +70,7 @@ class ArrayByteBuffer extends ByteBuffer {
|
||||
}
|
||||
|
||||
public ByteBuffer get(byte[] dst, int offset, int length) {
|
||||
checkGet(position, length);
|
||||
checkGet(position, length, false);
|
||||
|
||||
System.arraycopy(array, arrayOffset + position, dst, offset, length);
|
||||
position += length;
|
||||
|
Reference in New Issue
Block a user