Liquid piston compressor is the most promising compressor to be used for hydrogen-refueling stations. However, their energy transfer and the energy dissipation processes of are poorly studied and not well understood. In this paper, a new energy analysis method for an ionic-liquid type liquid piston compressor is proposed. In the compressor section, porous media is used to promote heat transfer from the hydraulic oil during the compression process. A mathematical model has been formulated considering the heat transfer and damping effects of the porous media on the compressor performance. Moreover, the compressibility of the hydraulic oil and its overflow loss on the compressor performance were also established. In the model, the seven stages of the entire working cycle of the compressor were look into in detail, alongside with its energy efficiency. The results show that the key parameters governing the energy efficiency of the compressor are the heat transfer efficiency of the compressor and the overflow losses of the hydraulic oil.