docs: private int write(ByteBuffer outbuf)
      {
          int nbytes;
          try {
              nbytes = fd.write(outbuf);
              if (nbytes == 0) {
                  errno.set(ZError.EAGAIN);
              }
          }
          catch (IOException e) {
              errno.set(ZError.ENOTCONN);
              nbytes = -1;
          }
  
          return nbytes;
      }