public static class ERXPropertyListSerialization._BinaryPListParser extends Object
bplist ::= header objectTable offsetTable trailer header ::= magicNumber fileFormatVersion magicNumber ::= "bplist" fileFormatVersion ::= "00" objectTable ::= { null | bool | fill | number | date | data | string | uid | array | dict } null ::= 0b0000 0b0000 bool ::= false | true false ::= 0b0000 0b1000 true ::= 0b0000 0b1001 fill ::= 0b0000 0b1111 // fill byte number ::= int | real int ::= 0b0001 0bnnnn byte*(2^nnnn) // 2^nnnn big-endian bytes real ::= 0b0010 0bnnnn byte*(2^nnnn) // 2^nnnn big-endian bytes date ::= 0b0011 0b0011 byte*8 // 8 byte float big-endian bytes data ::= 0b0100 0bnnnn [int] byte* // nnnn is number of bytes // unless 0b1111 then a int // variable-sized object follows // to indicate the number of bytes string ::= asciiString | unicodeString asciiString ::= 0b0101 0bnnnn [int] byte* unicodeString ::= 0b0110 0bnnnn [int] short* // nnnn is number of bytes // unless 0b1111 then a int // variable-sized object follows // to indicate the number of bytes uid ::= 0b1000 0bnnnn byte* // nnnn+1 is # of bytes array ::= 0b1010 0bnnnn [int] objref* // // nnnn is number of objref // unless 0b1111 then a int // variable-sized object follows // to indicate the number of objref dict ::= 0b1110 0bnnnn [int] keyref* objref* // nnnn is number of keyref and // objref pairs // unless 0b1111 then a int // variable-sized object follows // to indicate the number of pairs objref = byte | short // if refCount // is less than 256 then objref is // an unsigned byte, otherwise it // is an unsigned big-endian short keyref = byte | short // if refCount // is less than 256 then objref is // an unsigned byte, otherwise it // is an unsigned big-endian short unused ::= 0b0111 0bxxxx | 0b1001 0bxxxx | 0b1011 0bxxxx | 0b1100 0bxxxx | 0b1110 0bxxxx | 0b1111 0bxxxx offsetTable ::= { int } // list of ints, byte size of which // is given in trailer // these are the byte offsets into // the file // number of these is in the trailer trailer ::= trailerUnused trailerSortVersion offsetIntSize objectRefSize objectCount theTopObject offsetTableOffset trailerUnused ::= byte*5 // 5 unused bytes trailerSortVersion ::= byte // sortVersion 0x0, apparently not used in CF offsetIntSize ::= byte // Size (in bytes) of the ints in the offsetTable objectRefSize ::= byte // Size (in bytes) of the total number of objects references offsetCount ::= byte*8 // Object count, unsigned big-endian long theTopObject ::= byte*8 // Appears to be 0 in CF, unsigned big-endian long offsetTableOffset ::= byte*8 // Offset of the offset table, unsigned big-endian long
Modifier and Type | Class and Description |
---|---|
protected static class |
ERXPropertyListSerialization._BinaryPListParser.BinaryArray
Reference for a binary PList array element.
|
protected static class |
ERXPropertyListSerialization._BinaryPListParser.BinaryDict
Holder for a binary PList dict element.
|
protected static class |
ERXPropertyListSerialization._BinaryPListParser.BinarySet |
protected static class |
ERXPropertyListSerialization._BinaryPListParser.EncodedArray |
protected static class |
ERXPropertyListSerialization._BinaryPListParser.EncodedDictionary |
protected static class |
ERXPropertyListSerialization._BinaryPListParser.EncodedObject |
protected static class |
ERXPropertyListSerialization._BinaryPListParser.EncodedSet |
static class |
ERXPropertyListSerialization._BinaryPListParser.Type
Enum for binary property list types
|
Modifier and Type | Field and Description |
---|---|
protected static long |
ByteMaxValue |
protected static long |
IntegerMaxValue |
protected static long |
ShortMaxValue |
Constructor and Description |
---|
_BinaryPListParser()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_parseBinaryStream(InputStream is) |
protected Object |
_propertyListWithStream(InputStream is)
Returns the object represented by the given property list object loaded from the given stream.
|
protected static int |
byteArrayToInt2(byte[] b) |
protected static byte[] |
doubleToByteArray(double d,
int size)
convert double to byte array
|
protected long |
encodeObject(Object object,
List<ERXPropertyListSerialization._BinaryPListParser.EncodedObject> objectList,
Map<Object,Long> uniquingTable) |
protected static byte[] |
floatToByteArray(float f,
int size)
convert float to byte array
|
protected static byte[] |
intToByteArray(int param,
int size)
convert int to byte array
|
protected static byte[] |
intToByteArray2(int i,
int size) |
static boolean |
isBinaryPList(byte[] theBytes) |
protected static byte[] |
longToByteArray2(long l,
int size) |
Document |
propertyListDocumentWithStream(InputStream is) |
Document |
propertyListDocumentWithURL(URL url) |
Object |
propertyListWithStream(InputStream is)
Returns the object represented by the given property list object loaded from the given stream.
|
Object |
propertyListWithURL(URL url)
Returns the object represented by the given property list object loaded from the given URL.
|
protected static long |
readByte(byte[] bytes,
int startIndex) |
protected static long |
readInt(byte[] bytes,
int startIndex) |
protected static long |
readLong(byte[] bytes,
int startIndex) |
protected static long |
readShort(byte[] bytes,
int startIndex) |
protected Document |
toPropertyListDocument() |
protected static ERXPropertyListSerialization.PListType |
typeForObject(Object object) |
void |
writePropertyListToStream(Object plist,
OutputStream out)
Write binary plist to stream
|
protected static final long ByteMaxValue
protected static final long ShortMaxValue
protected static final long IntegerMaxValue
protected static long readByte(byte[] bytes, int startIndex) throws IOException
IOException
protected static long readShort(byte[] bytes, int startIndex) throws IOException
IOException
protected static long readInt(byte[] bytes, int startIndex) throws IOException
IOException
protected static long readLong(byte[] bytes, int startIndex) throws IOException
IOException
protected static byte[] doubleToByteArray(double d, int size)
d
- size
- either 4 or 8protected static byte[] floatToByteArray(float f, int size)
f
- size
- either 4 or 8protected static byte[] intToByteArray(int param, int size)
param
- size
- either 4 or 8protected static byte[] longToByteArray2(long l, int size)
protected static byte[] intToByteArray2(int i, int size)
protected static int byteArrayToInt2(byte[] b)
protected static ERXPropertyListSerialization.PListType typeForObject(Object object)
protected long encodeObject(Object object, List<ERXPropertyListSerialization._BinaryPListParser.EncodedObject> objectList, Map<Object,Long> uniquingTable)
public void writePropertyListToStream(Object plist, OutputStream out)
plist
- out
- ERXPropertyListSerialization.PListFormat
public Object propertyListWithURL(URL url)
url
- the URL to loadpublic Object propertyListWithStream(InputStream is)
is
- the InputStream to loadprotected Object _propertyListWithStream(InputStream is) throws IOException
is
- the InputStream to loadIOException
- if the loading failspublic Document propertyListDocumentWithStream(InputStream is)
protected Document toPropertyListDocument() throws ParserConfigurationException
ParserConfigurationException
public static boolean isBinaryPList(byte[] theBytes)
theBytes
- protected boolean _parseBinaryStream(InputStream is) throws IOException
IOException
Copyright © 2002 – 2020 Project Wonder.