In the 19th century there was a great deal of piracy, and it was secretly encouraged by the native rulers, who obtained a share of the spoil, and also by the Malays who knew well how to handle a boat.