Descriptions of messages 25 and 26 are based on AIS transceiver vendor documentation was originally forwarded to me by a source wishing to remain anonymous; I later checked them against ITU1371-4.Message type 27 was described in ITU1371-4 and added here after that became a freely available download.
The detail information on payload formats in this document is mostly derived from these public sources.
Kurt Schwehr is a research scientist at the Center for Coastal and Ocean Mapping at the University of New Hampshire. His work blog at [Schwehr] contains sample messages and descriptions of AIS operation in the wild that shed light on various obscure corners of the specification.
Alternatively, newer AIS receivers may report directly over RS232 or USB.
ITU Recommendation M.1371, "Technical Characteristics for a Universal Shipborne Automatic Identification System Using Time Division Multiple Access" [ITU1371], issued in 2001, first described the bit-level format of AIS radio messages.
Should you set out to write a decoder using this document, you are likely to find that one of your challenges is finding enough AIS packet data to make an effective regression test — especially if you live out of line of sight of any ship traffic and would get nothing from running an AIS receiver.