private static void writeEnumByte(BinaryRawWriter w,Enum e){
  w.writeByte(e == null ? 0 : (byte)e.ordinal());
}

private static void writeEnumByte ( BinaryRawWriter w , Enum e ) { w . writeByte ( e == null ? 0 : ( byte ) e . ordinal ( ) ) ; }
writes enum as byte .
