code: public final void putShort(int index, short value) {
  		final long pos = address + index;
  		if (index >= 0 && pos <= addressLimit - 2) {
  			UNSAFE.putShort(heapMemory, pos, value);
  		}
  		else if (address > addressLimit) {
  			throw new IllegalStateException("segment has been freed");
  		}
  		else {
  			// index is in fact invalid
  			throw new IndexOutOfBoundsException();
  		}
  	}
docs: Writes the given short value into this buffer at the given position, using
  the native byte order of the system.
  
  @param index The position at which the value will be written.
  @param value The short value to be written.
  
  @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment
  size minus 2.