code: @Override
      public int write(final ByteBuffer source) throws IOException {
  
          // Precondition checks
          this.checkClosed();
          if (source == null) {
              throw new IllegalArgumentException("Source buffer must be supplied");
          }
  
          // Put the bytes to be written into a byte[]
          final int totalBytes = source.remaining();
          final byte[] readContents = new byte[totalBytes];
          source.get(readContents);
  
          // Sync up, we're gonna access shared mutable state
          synchronized (this) {
  
              // Append the read contents to our internal contents
              this.contents = this.concat(this.contents, readContents, this.position);
  
              // Increment the position of this channel
              this.position += totalBytes;
  
          }
  
          // Return the number of bytes read
          return totalBytes;
      }
docs: {@inheritDoc}
  
  @see java.nio.channels.SeekableByteChannel#write(java.nio.ByteBuffer)