NOVELTY - The method involves heating biomass to temperature of 200-300 degrees C to produce a gas and the biofuel. A portion of gas is reformed to form fuel. A portion of fuel is converted to electrical energy or mechanical energy using heat engine such as internal combustion engine or turbine. Thermal energy is recovered from an exhaust of heat engine and from a portion of fuel.    USE - Method for converting biomass into biofuel.    ADVANTAGE - The time and cost required for conversion of biomass into biofuel can be reduced.    DETAILED DESCRIPTION - The biomass heating process includes torrefying the biomass at torrefaction temperature during torrefaction time. The amount of fuel from reformer and the amount of fuel from gasifier are adjusted to vary the characteristics of biofuel. The steam evolved during the drying of biomass is compressed to predetermined steam pressure. The energy of compressed steam is utilized for drying the biomass. The temperature and pressure of steam is sensed. The temperature of dried biomass is sensed. The dryness of dried biomass is controlled by adjusting the compressed steam pressure. The flow rate and composition of gases evolved from biomass are controlled by adjusting the temperature of the torrefied biomass and flow rate of the biomass. An INDEPENDENT CLAIM is included for biomass-to-biofuel conversion apparatus (200) that includes a reactor with biomass transporting portion and heat transfer medium transporting portion. The biomass transporting portion has inlet to accept the biomass, outlet to output treated biomass and gas outlet to output the gases evolved from the biomass. The heat transfer medium transporting portion has an inlet to accept the heat transfer medium and outlet to output the heat transfer medium. Reformer has an inlet in fluid communication with the outlet of biomass transporting portion. Heat exchanger provides thermal contact between the heat transfer medium and the fuel. The heat exchanger recovers thermal energy for the reactor. A boiler recovers thermal energy from biofuel and reformer. A control system controls the temperature of biomass within reactor. The heat engine is coupled to generator. Sensors measure the temperature, pressure and composition of the biomass within the reactor. The control system adjusts the solid feed rate and the temperature of the biomass within reactor to dynamically adjust the volume and composition of the gases evolved from the biomass.    DESCRIPTION OF DRAWING(S) - The drawing shows a block diagram of the biomass-to-biofuel conversion apparatus.    Biomass-to-biofuel conversion apparatus (200)    Solid processing module (210)    Heat transfer module (220)    Gas processing module (230)    Power generation module (240)