The Nutmeg of Consolation by Patrick O'Brian
Shipwrecked on a remote island in the Dutch East Indies, Captain Aubrey, surgeon and secret intelligence agent Stephen Maturin, and the crew of the Diane fashion a schooner from the wreck. A vicious attack by Malay pirates is repulsed, but the makeshift vessel burns, and they are truly marooned. Their escape from this predicament is one that only the whimsy and ingenuity of Patrick O'Brian-or Stephen Maturin-could devise.
In command now of a new ship, the Nutmeg, Aubrey pursues his interrupted mission. The dreadful penal colony in New South Wales, harrowingly described, is the backdrop to a diplomatic crisis provoked by Maturin's Irish temper, and to a near-fatal encounter with the wildlife of the Australian outback.