Fixes bug with serialising pages greater than 64 kb

java.io.DataOutputStream (and java.io.ObjectOutputStream too for the matter) is not able to serialize strings larger than 64KB (http://www.drillio.com/en/software-development/java/encoded-string-too-long-64kb-limit/).