HDFS-2856: better encapsulation of magic number handling.