If your linked list doesn't have loops, then the fact that this is a "linked list" is a memory detail, not a serialization detail. Just write the node values out into the file and build the next
pointers when you deserialize.
However, if your linked list does have loops, then you'll need something smarter. You'll need to store next
pointers as a file offsets to the node (or something similar) to encode the "link".
For each node in your linked list, store two words. The first is the data, the second is the offset of the next
node. Here is an illustration of the circularly linked list:
+-> 1234 -> 5678 -> 2398 -+
| |
+-------------------------+
0 : 4bytes: 1234 : int data <------------+
4 : 4bytes: 8 : offset of next node -+ |
| |
8 : 4bytes: 5678 : int data <----------+ |
12 : 4bytes: 16 : offset of next node -+ |
| |
16 : 4bytes: 2398 : int data <----------+ |
20 : 4bytes: 0 : offset of next node ---+