public final int read(ByteBuffer buf, int pos, int limit) throws IOException { int res = read(fd, buf, pos, limit); if (res > 0) { return res; } if (res == 0) { return -1; } return ioResult("read", res, READ_CONNECTION_RESET_EXCEPTION, READ_CLOSED_CHANNEL_EXCEPTION); }
public static int sendmmsg( int fd, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws IOException { int res = sendmmsg0(fd, msgs, offset, len); if (res >= 0) { return res; } return ioResult("sendmmsg", res, SENDMMSG_CONNECTION_RESET_EXCEPTION, SENDMMSG_CLOSED_CHANNEL_EXCEPTION); }
public final int writeAddress(long address, int pos, int limit) throws IOException { int res = writeAddress(fd, address, pos, limit); if (res >= 0) { return res; } return ioResult("writeAddress", res, WRITE_ADDRESS_CONNECTION_RESET_EXCEPTION, WRITE_ADDRESS_CLOSED_CHANNEL_EXCEPTION); }
public final long writevAddresses(long memoryAddress, int length) throws IOException { long res = writevAddresses(fd, memoryAddress, length); if (res >= 0) { return res; } return ioResult("writevAddresses", (int) res, WRITEV_ADDRESSES_CONNECTION_RESET_EXCEPTION, WRITEV_ADDRESSES_CLOSED_CHANNEL_EXCEPTION); }
public final int readAddress(long address, int pos, int limit) throws IOException { int res = readAddress(fd, address, pos, limit); if (res > 0) { return res; } if (res == 0) { return -1; } return ioResult("readAddress", res, READ_ADDRESS_CONNECTION_RESET_EXCEPTION, READ_ADDRESS_CLOSED_CHANNEL_EXCEPTION); }
public static int splice(int fd, long offIn, int fdOut, long offOut, long len) throws IOException { int res = splice0(fd, offIn, fdOut, offOut, len); if (res >= 0) { return res; } return ioResult("splice", res, SPLICE_CONNECTION_RESET_EXCEPTION, SPLICE_CLOSED_CHANNEL_EXCEPTION); }
public final int write(ByteBuffer buf, int pos, int limit) throws IOException { int res = write(fd, buf, pos, limit); if (res >= 0) { return res; } return ioResult("write", res, WRITE_CONNECTION_RESET_EXCEPTION, WRITE_CLOSED_CHANNEL_EXCEPTION); }
public final long writev(ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) throws IOException { long res = writev(fd, buffers, offset, min(IOV_MAX, length), maxBytesToWrite); if (res >= 0) { return res; } return ioResult("writev", (int) res, WRITEV_CONNECTION_RESET_EXCEPTION, WRITEV_CLOSED_CHANNEL_EXCEPTION); }
public static int sendmmsg( int fd, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws IOException { int res = sendmmsg0(fd, msgs, offset, len); if (res >= 0) { return res; } return ioResult("sendmmsg", res, SENDMMSG_CONNECTION_RESET_EXCEPTION, SENDMMSG_CLOSED_CHANNEL_EXCEPTION); }
public static int splice(int fd, long offIn, int fdOut, long offOut, long len) throws IOException { int res = splice0(fd, offIn, fdOut, offOut, len); if (res >= 0) { return res; } return ioResult("splice", res, SPLICE_CONNECTION_RESET_EXCEPTION, SPLICE_CLOSED_CHANNEL_EXCEPTION); }
public final int readAddress(long address, int pos, int limit) throws IOException { int res = readAddress(fd, address, pos, limit); if (res > 0) { return res; } if (res == 0) { return -1; } return ioResult("readAddress", res, READ_ADDRESS_CONNECTION_RESET_EXCEPTION, READ_ADDRESS_CLOSED_CHANNEL_EXCEPTION); }
public final int write(ByteBuffer buf, int pos, int limit) throws IOException { int res = write(fd, buf, pos, limit); if (res >= 0) { return res; } return ioResult("write", res, WRITE_CONNECTION_RESET_EXCEPTION, WRITE_CLOSED_CHANNEL_EXCEPTION); }
public final long writevAddresses(long memoryAddress, int length) throws IOException { long res = writevAddresses(fd, memoryAddress, length); if (res >= 0) { return res; } return ioResult("writevAddresses", (int) res, WRITEV_ADDRESSES_CONNECTION_RESET_EXCEPTION, WRITEV_ADDRESSES_CLOSED_CHANNEL_EXCEPTION); }
public final int writeAddress(long address, int pos, int limit) throws IOException { int res = writeAddress(fd, address, pos, limit); if (res >= 0) { return res; } return ioResult("writeAddress", res, WRITE_ADDRESS_CONNECTION_RESET_EXCEPTION, WRITE_ADDRESS_CLOSED_CHANNEL_EXCEPTION); }
public final int read(ByteBuffer buf, int pos, int limit) throws IOException { int res = read(fd, buf, pos, limit); if (res > 0) { return res; } if (res == 0) { return -1; } return ioResult("read", res, READ_CONNECTION_RESET_EXCEPTION, READ_CLOSED_CHANNEL_EXCEPTION); }
long sendFile(DefaultFileRegion src, long baseOffset, long offset, long length) throws IOException { // Open the file-region as it may be created via the lazy constructor. This is needed as we directly access // the FileChannel field via JNI. src.open(); long res = sendFile(intValue(), src, baseOffset, offset, length); if (res >= 0) { return res; } return ioResult("sendfile", (int) res, SENDFILE_CONNECTION_RESET_EXCEPTION, SENDFILE_CLOSED_CHANNEL_EXCEPTION); }
long sendFile(DefaultFileRegion src, long baseOffset, long offset, long length) throws IOException { // Open the file-region as it may be created via the lazy constructor. This is needed as we directly access // the FileChannel field via JNI. src.open(); long res = sendFile(intValue(), src, baseOffset, offset, length); if (res >= 0) { return res; } return ioResult("sendfile", (int) res, SENDFILE_CONNECTION_RESET_EXCEPTION, SENDFILE_CLOSED_CHANNEL_EXCEPTION); }
public final int sendToAddresses(long memoryAddress, int length, InetAddress addr, int port) throws IOException { // just duplicate the toNativeInetAddress code here to minimize object creation as this method is expected // to be called frequently byte[] address; int scopeId; if (addr instanceof Inet6Address) { address = addr.getAddress(); scopeId = ((Inet6Address) addr).getScopeId(); } else { // convert to ipv4 mapped ipv6 address; scopeId = 0; address = ipv4MappedIpv6Address(addr.getAddress()); } int res = sendToAddresses(fd, memoryAddress, length, address, scopeId, port); if (res >= 0) { return res; } if (res == ERROR_ECONNREFUSED_NEGATIVE) { throw new PortUnreachableException("sendToAddresses failed"); } return ioResult("sendToAddresses", res, CONNECTION_RESET_EXCEPTION_SENDMSG, SEND_TO_ADDRESSES_CLOSED_CHANNEL_EXCEPTION); }
long sendFile(DefaultFileRegion src, long baseOffset, long offset, long length) throws IOException { // Open the file-region as it may be created via the lazy constructor. This is needed as we directly access // the FileChannel field via JNI. src.open(); long res = sendFile(intValue(), src, baseOffset, offset, length); if (res >= 0) { return res; } return ioResult("sendfile", (int) res, SENDFILE_CONNECTION_RESET_EXCEPTION, SENDFILE_CLOSED_CHANNEL_EXCEPTION); }
long sendFile(DefaultFileRegion src, long baseOffset, long offset, long length) throws IOException { // Open the file-region as it may be created via the lazy constructor. This is needed as we directly access // the FileChannel field via JNI. src.open(); long res = sendFile(intValue(), src, baseOffset, offset, length); if (res >= 0) { return res; } return ioResult("sendfile", (int) res, SENDFILE_CONNECTION_RESET_EXCEPTION, SENDFILE_CLOSED_CHANNEL_EXCEPTION); }