@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }
@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int write(ByteBuffer src) throws IOException { checkNotNull(src); checkOpenConnected(); if (!src.hasRemaining()) { return 0; } int writeCount = writeImpl(src); if (writeCount > 0) { src.position(src.position() + writeCount); } return writeCount; }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }
@Override public int send(ByteBuffer source, SocketAddress socketAddress) throws IOException { checkNotNull(source); checkOpen(); InetSocketAddress isa = (InetSocketAddress) socketAddress; if (isa.getAddress() == null) { throw new IOException(); } if (isConnected() && !connectAddress.equals(isa)) { throw new IllegalArgumentException("Connected to " + connectAddress + ", not " + socketAddress); } synchronized (writeLock) { int sendCount = 0; try { begin(); int oldPosition = source.position(); sendCount = IoBridge.sendto(fd, source, 0, isa.getAddress(), isa.getPort()); if (sendCount > 0) { source.position(oldPosition + sendCount); } isBound = true; } finally { end(sendCount >= 0); } return sendCount; } }