|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.plist.io.PropertyListParser
net.sf.plist.io.bin.BinaryParser
public class BinaryParser
Parses binary property list files to a tree consisting of NSObject
s
Field Summary | |
---|---|
static byte |
ARRAY
Byte mask indicating a array value |
static Charset |
ASCIICHARSET
Charset to parse ASCII strings |
static byte |
ASCIISTRING
Byte mask indicating a ascii string value |
static byte |
BOOLFALSE
Byte indicating a Boolean.FALSE value |
static byte |
BOOLTRUE
Byte indicating a Boolean.TRUE value |
static byte |
DATA
Byte mask indicating a binary data value |
static byte |
DATE
Byte mask indicating a date value |
static byte |
DICT
Byte mask indicating a dictionary value |
protected static byte[] |
ENDMAGIC
Bytes expected near the end of the file |
static long |
EPOCH
Epoch constant, used to calculate dates |
static byte |
FILL
Filler byte |
static byte |
INT
Byte mask indicating a integer value |
static byte |
LENMASK
Mask for extracting the length |
static byte |
NULL
NULL byte |
protected int |
numObjects
Number of objects in stream |
static byte |
OBJMASK
Mask for extracting the objecttype (result must be shifted right 4 bits) |
protected byte |
objRefSize
Size of object references in bytes |
protected byte |
offsetEntrySize
Size of offset entries in bytes |
protected int[] |
offsetTable
The offset table |
protected long |
offsetTableOffset
Starting address of the offset table |
static byte |
REAL
Byte mask indicating a real value |
protected long |
rootAddr
Starting address of the root object |
static byte |
SET
Byte mask indicating a set value (not implemented) |
protected static byte[] |
STARTMAGIC
Bytes expected at the start of the file |
static byte |
UID
Byte mask indicating a uid value (not implemented) |
static Charset |
UNICODECHARSET
Charset to parse unicode strings |
static byte |
UNICODESTRING
Byte mask indicating a unicode string value |
Fields inherited from class net.sf.plist.io.PropertyListParser |
---|
file, input |
Constructor Summary | |
---|---|
BinaryParser(File file)
|
|
BinaryParser(InputStream input)
Not supported yet. |
Method Summary | |
---|---|
static int |
getInteger(byte... bytes)
Convert an array of bytes to a integer |
protected int |
getLength(byte lengthMask)
Read the length When the lengthMask is 0xF (0000 1111), an integer follows containing the actual length lengthMask must be equal or smaller than LENMASK |
static long |
getLong(byte... bytes)
Convert an array of bytes to a long |
NSObject |
parse()
Parse the property list to a tree |
protected NSArray |
parseArray(byte length)
Parse a node to a NSArray on a given start address |
protected NSString |
parseASCII(byte length)
Parse a node to a NSString on a given start address, parsing with an ASCII charset |
protected NSData |
parseData(byte length)
Parse a node to a NSData on a given start address |
protected NSDate |
parseDate(byte length)
Parse a node to a NSDate on a given start address |
protected NSDictionary |
parseDictionary(byte length)
Parse a node to a NSDictionary on a given start address |
protected NSInteger |
parseInteger(byte length)
Parse a node to a NSInteger on a given start address |
protected NSObject |
parseNode(long addr)
Parse a node to a NSObject on a given start address |
protected NSReal |
parseReal(byte length)
Parse a node to a NSReal on a given start address |
protected NSObject |
parseSet(byte length)
Parse a NSSet (not implemented) |
protected NSObject |
parseUid(byte length)
Parse a NSUID (not implemented) |
protected NSString |
parseUnicode(byte length)
Parse a node to a NSString on a given start address, parsing with an unicode charset |
Methods inherited from class net.sf.plist.io.PropertyListParser |
---|
parse, parse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte NULL
public static final byte BOOLFALSE
Boolean.FALSE
value
public static final byte BOOLTRUE
Boolean.TRUE
value
public static final byte FILL
public static final byte INT
public static final byte REAL
public static final byte DATE
public static final byte DATA
public static final byte ASCIISTRING
public static final byte UNICODESTRING
public static final byte UID
public static final byte ARRAY
public static final byte SET
public static final byte DICT
public static final byte OBJMASK
public static final byte LENMASK
protected static final byte[] STARTMAGIC
protected static final byte[] ENDMAGIC
public static final Charset ASCIICHARSET
public static final Charset UNICODECHARSET
public static final long EPOCH
protected final byte offsetEntrySize
protected final byte objRefSize
protected final int numObjects
protected final long rootAddr
protected final long offsetTableOffset
protected final int[] offsetTable
Constructor Detail |
---|
public BinaryParser(File file) throws IOException, PropertyListException
IOException
PropertyListException
PropertyListParser.PropertyListParser(File)
public BinaryParser(InputStream input)
UnsupportedOperationException
- because this is not supported yetMethod Detail |
---|
public static long getLong(byte... bytes)
bytes
- the byte array (8 bytes max)
public static int getInteger(byte... bytes)
bytes
- the byte array (4 bytes max)
public NSObject parse() throws PropertyListException
parse
in class PropertyListParser
NSObject
of the parsed property list
PropertyListException
- when parsing the property list failed for some reasonprotected NSObject parseNode(long addr) throws IOException, PropertyListException
addr
- the start address
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSInteger parseInteger(byte length) throws IOException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSReal parseReal(byte length) throws IOException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSDate parseDate(byte length) throws IOException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSData parseData(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSString parseASCII(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSString parseUnicode(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSObject parseUid(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSArray parseArray(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSObject parseSet(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected NSDictionary parseDictionary(byte length) throws IOException, PropertyListException
length
- the length byte
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing failsprotected int getLength(byte lengthMask) throws IOException, PropertyListException
Read the length
When the lengthMask is 0xF (0000 1111), an integer follows containing the actual length
lengthMask must be equal or smaller than LENMASK
lengthMask
- the length mask
IOException
- when reading the stream failed while parsing
PropertyListException
- when parsing fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |