@@ -133,6 +133,8 @@ private static int determineType(InputStream is) throws IOException {
133
133
* a maximum count.
134
134
*
135
135
* @param in The InputStream pointing to the data that should be stored in the array.
136
+ * @return An array containing all bytes that were read from the input stream.
137
+ * @throws java.io.IOException When an IO error while reading from the input stream.
136
138
*/
137
139
protected static byte [] readAll (InputStream in ) throws IOException {
138
140
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
@@ -151,6 +153,12 @@ protected static byte[] readAll(InputStream in) throws IOException {
151
153
*
152
154
* @param filePath Path to the property list file.
153
155
* @return The root object in the property list. This is usually a NSDictionary but can also be a NSArray.
156
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
157
+ * could not be created. This should not occur.
158
+ * @throws java.io.IOException If any IO error occurs while reading the file.
159
+ * @throws org.xml.sax.SAXException If any parse error occurs.
160
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
161
+ * @throws java.text.ParseException If a date string could not be parsed.
154
162
*/
155
163
public static NSObject parse (String filePath ) throws ParserConfigurationException , ParseException , SAXException , PropertyListFormatException , IOException {
156
164
return parse (new File (filePath ));
@@ -161,6 +169,12 @@ public static NSObject parse(String filePath) throws ParserConfigurationExceptio
161
169
*
162
170
* @param f The property list file.
163
171
* @return The root object in the property list. This is usually a NSDictionary but can also be a NSArray.
172
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
173
+ * could not be created. This should not occur.
174
+ * @throws java.io.IOException If any IO error occurs while reading the file.
175
+ * @throws org.xml.sax.SAXException If any parse error occurs.
176
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
177
+ * @throws java.text.ParseException If a date string could not be parsed.
164
178
*/
165
179
public static NSObject parse (File f ) throws IOException , PropertyListFormatException , ParseException , ParserConfigurationException , SAXException {
166
180
FileInputStream fis = new FileInputStream (f );
@@ -183,6 +197,12 @@ public static NSObject parse(File f) throws IOException, PropertyListFormatExcep
183
197
*
184
198
* @param bytes The property list data as a byte array.
185
199
* @return The root object in the property list. This is usually a NSDictionary but can also be a NSArray.
200
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
201
+ * could not be created. This should not occur.
202
+ * @throws java.io.IOException If any IO error occurs while reading the byte array.
203
+ * @throws org.xml.sax.SAXException If any parse error occurs.
204
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
205
+ * @throws java.text.ParseException If a date string could not be parsed.
186
206
*/
187
207
public static NSObject parse (byte [] bytes ) throws IOException , PropertyListFormatException , ParseException , ParserConfigurationException , SAXException {
188
208
switch (determineType (bytes )) {
@@ -202,6 +222,12 @@ public static NSObject parse(byte[] bytes) throws IOException, PropertyListForma
202
222
*
203
223
* @param is The InputStream delivering the property list data.
204
224
* @return The root object of the property list. This is usually a NSDictionary but can also be a NSArray.
225
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
226
+ * could not be created. This should not occur.
227
+ * @throws java.io.IOException If any IO error occurs while reading the input stream.
228
+ * @throws org.xml.sax.SAXException If any parse error occurs.
229
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
230
+ * @throws java.text.ParseException If a date string could not be parsed.
205
231
*/
206
232
public static NSObject parse (InputStream is ) throws IOException , PropertyListFormatException , ParseException , ParserConfigurationException , SAXException {
207
233
return parse (readAll (is ));
@@ -242,6 +268,13 @@ public static void saveAsXML(NSObject root, OutputStream out) throws IOException
242
268
*
243
269
* @param in The source file.
244
270
* @param out The target file.
271
+ *
272
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
273
+ * could not be created. This should not occur.
274
+ * @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
275
+ * @throws org.xml.sax.SAXException If any parse error occurs.
276
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
277
+ * @throws java.text.ParseException If a date string could not be parsed.
245
278
*/
246
279
public static void convertToXml (File in , File out ) throws ParserConfigurationException , ParseException , SAXException , PropertyListFormatException , IOException {
247
280
NSObject root = parse (in );
@@ -279,6 +312,12 @@ public static void saveAsBinary(NSObject root, OutputStream out) throws IOExcept
279
312
*
280
313
* @param in The source file.
281
314
* @param out The target file.
315
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
316
+ * could not be created. This should not occur.
317
+ * @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
318
+ * @throws org.xml.sax.SAXException If any parse error occurs.
319
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
320
+ * @throws java.text.ParseException If a date string could not be parsed.
282
321
*/
283
322
public static void convertToBinary (File in , File out ) throws IOException , ParserConfigurationException , ParseException , SAXException , PropertyListFormatException {
284
323
NSObject root = parse (in );
@@ -320,6 +359,12 @@ public static void saveAsASCII(NSArray root, File out) throws IOException {
320
359
*
321
360
* @param in The source file.
322
361
* @param out The target file.
362
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
363
+ * could not be created. This should not occur.
364
+ * @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
365
+ * @throws org.xml.sax.SAXException If any parse error occurs.
366
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
367
+ * @throws java.text.ParseException If a date string could not be parsed.
323
368
*/
324
369
public static void convertToASCII (File in , File out ) throws ParserConfigurationException , ParseException , SAXException , PropertyListFormatException , IOException {
325
370
NSObject root = parse (in );
@@ -374,6 +419,12 @@ public static void saveAsGnuStepASCII(NSArray root, File out) throws IOException
374
419
*
375
420
* @param in The source file.
376
421
* @param out The target file.
422
+ * @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
423
+ * could not be created. This should not occur.
424
+ * @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
425
+ * @throws org.xml.sax.SAXException If any parse error occurs.
426
+ * @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
427
+ * @throws java.text.ParseException If a date string could not be parsed.
377
428
*/
378
429
public static void convertToGnuStepASCII (File in , File out ) throws ParserConfigurationException , ParseException , SAXException , PropertyListFormatException , IOException {
379
430
NSObject root = parse (in );
0 commit comments