public final class BinaryPropertyListParser extends Object
Parsing is done by calling the static parse
methods.
Modifier and Type | Method and Description |
---|---|
static byte[] |
copyOfRange(byte[] src,
int startIndex,
int endIndex)
Copies a part of a byte array into a new array.
|
static NSObject |
parse(byte[] data)
Parses a binary property list from a byte array.
|
static NSObject |
parse(File f)
Parses a binary property list file.
|
static NSObject |
parse(InputStream is)
Parses a binary property list from an input stream.
|
static NSObject |
parse(Path path)
Parses a binary property list file.
|
static double |
parseDouble(byte[] bytes)
Parses a double from a (big-endian) byte array.
|
static double |
parseDouble(byte[] bytes,
int startIndex,
int endIndex)
Parses a double from a (big-endian) byte array.
|
static long |
parseLong(byte[] bytes)
Parses a long from a (big-endian) byte array.
|
static long |
parseLong(byte[] bytes,
int startIndex,
int endIndex)
Parses a long from a (big-endian) byte array.
|
static long |
parseUnsignedInt(byte[] bytes)
Parses an unsigned integers from a byte array.
|
static long |
parseUnsignedInt(byte[] bytes,
int startIndex,
int endIndex)
Parses an unsigned integer from a byte array.
|
public static NSObject parse(File f) throws IOException, PropertyListFormatException
f
- The binary property list fileNSDictionary
but can also be a NSArray
.PropertyListFormatException
- When the property list's format could not be parsed.IOException
- If a NSString
object could not be decoded or an I/O error occurs on the input stream.public static NSObject parse(Path path) throws IOException, PropertyListFormatException
path
- The path to the binary property list fileNSDictionary
but can also be a NSArray
.PropertyListFormatException
- When the property list's format could not be parsed.IOException
- If a NSString
object could not be decoded or an I/O error occurs on the input stream.public static NSObject parse(InputStream is) throws IOException, PropertyListFormatException
is
- The input stream that points to the property list's data.NSDictionary
but can also be a NSArray
.PropertyListFormatException
- When the property list's format could not be parsed.IOException
- If a NSString
object could not be decoded or an I/O error occurs on the input stream.public static NSObject parse(byte[] data) throws PropertyListFormatException, UnsupportedEncodingException
data
- The binary property list's data.NSDictionary
but can also be a NSArray
.PropertyListFormatException
- When the property list's format could not be parsed.UnsupportedEncodingException
- If a NSString
object could not be decoded.public static long parseUnsignedInt(byte[] bytes)
bytes
- The byte array containing the unsigned integer.public static long parseUnsignedInt(byte[] bytes, int startIndex, int endIndex)
bytes
- The byte array containing the unsigned integer.startIndex
- Beginning of the unsigned int in the byte array.endIndex
- End of the unsigned int in the byte array.public static long parseLong(byte[] bytes)
bytes
- The bytes representing the long integer.public static long parseLong(byte[] bytes, int startIndex, int endIndex)
bytes
- The bytes representing the long integer.startIndex
- Beginning of the long in the byte array.endIndex
- End of the long in the byte array.public static double parseDouble(byte[] bytes)
bytes
- The bytes representing the double.public static double parseDouble(byte[] bytes, int startIndex, int endIndex)
bytes
- The bytes representing the double.startIndex
- Beginning of the double in the byte array.endIndex
- End of the double in the byte array.public static byte[] copyOfRange(byte[] src, int startIndex, int endIndex)
src
- The source array.startIndex
- The index from which to start copying.endIndex
- The index until which to copy.Copyright © 2024. All rights reserved.