code: public boolean write(GatheringByteChannel ch) throws Exception {
          int num_buffers_to_write=size();
          if(num_buffers_to_write == 0)
              return true;
  
          if(ch != null) {
              try {
                  ch.write(bufs, position, num_buffers_to_write);
              }
              catch(ClosedChannelException closed_ex) {
                  throw closed_ex;
              }
              catch(NotYetConnectedException | IOException others) {
                  ; // ignore, we'll queue 1 write
              }
          }
  
          return nullData();
      }
docs: Writes the buffers from position to limit to the given channel. Note that all buffers need to have
  their {@link ByteBuffer#position} at the start of the data to be written
  be at the start of the data to be written.
  @param ch The channel to write to
  @return True if all the bytes of the buffer were written successfully, false otherwise (partial write).
  @throws Exception Thrown if the write failed