BitPack bitpack = new BitPack(layer.LayerData.Data, 0);
TerrainPatch.GroupHeader header = new TerrainPatch.GroupHeader();
TerrainPatch.LayerType type = TerrainPatch.LayerType.get(layer.LayerID.Type);
// Stride
header.Stride = bitpack.UnpackBits(16);
// Patch size
header.PatchSize = bitpack.UnpackBits(8);
// Layer type
header.Type = TerrainPatch.LayerType.get((byte)bitpack.UnpackBits(8));