接下来的Color mode Data跟Image Resources经过研究,在这里,这部分数据没有用到,所以直接把他们所占用的字节长度给读取出来过滤掉:
Color mode data:
public final class PsdColorModeDataVo
{
public var len:int;
public var data:ByteArray;
public function parse(ba:FileStream):void
{
data = new ByteArray();
len = ba.readInt(); //rgb是0
if(0 != len)
{
ba.readBytes(data, 0, len);
}
}
}
public final class PsdImageResourcesVo
{
public var len:int;
public var data:ByteArray;
private var osType:String;
private var id:Number;
private var pName:String;
private var size:int;
public function parse(ba:FileStream):void
{
data = new ByteArray();
len = ba.readInt();
if(0 != len)
{
ba.readBytes(data, 0, len);
osType = data.readUTFBytes(4);
id = data.readShort();
pName = data.readUTF();
size = data.readInt();
}
}
}
public final class PsdLayerAndMaskVo
{
public var len:int;
public var data:ByteArray;
public function parse(ba:FileStream):void
{
data = new ByteArray();
len = ba.readInt();
if(0 != len)
{
ba.readBytes(data, 0, len);
}
}
}
经过上面的几次读取,剩下来的就是Image data部分,这部分也不管它。