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 ( ) ; } }
Writes the given short value into this buffer at the given position using the native byte order of the system .