code: public WriteStream writeStream() {
  		detachReader();
  		if (writer == null) {
  			writer = new BytesWriteStream(bytes, maxCapacity);
  		}
  		return writer;
  	}
docs: Attaches a writer to the object. If there is already an attached writer,
  the existing writer is returned. If a reader is attached to the object
  when this method is called, the reader is closed and immediately detached
  before a writer is created.
  
  @return the writer attached to this object