public long write(final ByteBuffer[] srcs, final int offs, final int len) throws IOException {
   if (allAreSet(state, WRITE_SHUTDOWN)) {
     throw new ClosedChannelException();
   }
   final long res = Native.writeGather(fd, srcs, offs, len);
   if (res == 0) state &= ~WRITE_READY;
   checkWriteTimeout(res > 0);
   return res;
 }