Compression of nanowires using a flat indenter: Elasticity measurement in nanoscale