How are the buffer and buffer spring retained inside the the extension tube?

On the AR15/ M16, the spring is retained by the buffer. The buffer is retained by a pin located at the lower outer edge of the extension tube.