public static byte[] writeToArray(NSObject root) throws IOException {
  ByteArrayOutputStream bout=new ByteArrayOutputStream();
  write(bout,root);
  return bout.toByteArray();
}

public static byte [ ] writeToArray ( NSObject root ) throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; write ( bout , root ) ; return bout . toByteArray ( ) ; }
writes a binary plist serialization of the given object as the root into a byte array .
