接下來的Color mode Data跟Image Resources通過研究,在這裏,這部分數據沒有用到,因此直接把他們所佔用的字節長度給讀取出來過濾掉: spa
Color mode data: code
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部分,這部分也無論它。 io