Class BinaryPropertyListWriter

java.lang.Object
com.dd.plist.BinaryPropertyListWriter

public final class BinaryPropertyListWriter extends Object
Writes property lists in the binary format.
Author:
Keith Randall
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    write(NSObject root, File file)
    Writes a binary plist file with the given object as the root.
    static void
    write(NSObject root, File file, boolean createParentDirectories)
    Writes a binary plist file with the given object as the root.
    static void
    Writes a binary plist serialization of the given object as the root.
    static void
    write(NSObject root, Path path)
    Writes a binary plist file with the given object as the root.
    static void
    write(File file, NSObject root)
    Deprecated.
    Use the overload that takes the root as first argument and the file as second.
    static void
    Deprecated.
    Use the overload that takes the root as first argument and the stream as second.
    static byte[]
    Writes a binary plist serialization of the given object as the root into a byte array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • write

      @Deprecated public static void write(File file, NSObject root) throws IOException
      Deprecated.
      Use the overload that takes the root as first argument and the file as second.
      Writes a binary plist file with the given object as the root.
      Parameters:
      file - The file to write to.
      root - The source of the data to write to the file.
      Throws:
      IOException - If an I/O error occurs while writing to the file or the object structure contains data that cannot be saved.
    • write

      public static void write(NSObject root, File file) throws IOException
      Writes a binary plist file with the given object as the root.
      Parameters:
      root - The source of the data to write to the file.
      file - The file to write to.
      Throws:
      IOException - If an I/O error occurs while writing to the file or the object structure contains data that cannot be saved.
    • write

      public static void write(NSObject root, File file, boolean createParentDirectories) throws IOException
      Writes a binary plist file with the given object as the root.
      Parameters:
      root - The source of the data to write to the file.
      file - The file to write to.
      createParentDirectories - If set to true, the file's parent directories will be created.
      Throws:
      IOException - If an I/O error occurs while writing to the file or the object structure contains data that cannot be saved.
    • write

      public static void write(NSObject root, Path path) throws IOException
      Writes a binary plist file with the given object as the root.
      Parameters:
      root - The source of the data to write to the file.
      path - The path of the file to write to.
      Throws:
      IOException - If an I/O error occurs while writing to the file or the object structure contains data that cannot be saved.
    • write

      @Deprecated public static void write(OutputStream out, NSObject root) throws IOException
      Deprecated.
      Use the overload that takes the root as first argument and the stream as second.
      Writes a binary plist serialization of the given object as the root. This method does not close the output stream.
      Parameters:
      out - The stream to write to.
      root - The source of the data to write to the stream.
      Throws:
      IOException - If an I/O error occurs while writing to the stream or the object structure contains data that cannot be saved.
    • write

      public static void write(NSObject root, OutputStream out) throws IOException
      Writes a binary plist serialization of the given object as the root. This method does not close the output stream.
      Parameters:
      root - The source of the data to write to the stream.
      out - The stream to write to.
      Throws:
      IOException - If an I/O error occurs while writing to the stream or the object structure contains data that cannot be saved.
    • writeToArray

      public static byte[] writeToArray(NSObject root) throws IOException
      Writes a binary plist serialization of the given object as the root into a byte array.
      Parameters:
      root - The root object of the property list
      Returns:
      The byte array containing the serialized property list
      Throws:
      IOException - If an I/O error occurs while writing to the stream or the object structure contains data that cannot be saved.