There is disclosed a method for processing a biomass (for example straw) containing lignocellulose such that cellulose and hemicellulose are made accessible for further processing, typically by decomposition, without needing energy-consuming dissolution of the biomass in water. The method includes repeated compressions of the biomass in a reciprocating piston press, where loose biomass is continuously fed into a piston chamber in front of a piston which moves the loose biomass into a tubular reaction chamber in which the biomass is compressed for producing a vapour explosion and autohydrolysis under simultaneous displacement of compressed biomass through the reaction chamber. After compression, the biomass can be added fluid livestock manure, fluid waster water sludge etc. in a biogas plant for a subsequent biogas process.