public ReadData ( |
||
binaryReader | Binary reader. | |
flags | byte | Flags. |
Результат | void |
/// <summary> /// Reads the data. /// </summary> /// <param name="binaryReader">Binary reader.</param> /// <param name="shapeType">Shape type.</param> public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType) { binaryReader.SynchBits(); byte numFillBits = (byte)binaryReader.ReadUBits(4); byte numLineBits = (byte)binaryReader.ReadUBits(4); bool readEndShapeRecord = false; while (!readEndShapeRecord) { bool type = binaryReader.ReadBoolean(); byte flags = (byte)binaryReader.ReadUBits(5); if (type == false) { //Non-edge record if (flags == 0) { //EndShapeRecord readEndShapeRecord = true; this.Add(new EndShapeRecord()); } else { //StyleChangerecord StyleChangeRecord styleChange = new StyleChangeRecord(); styleChange.ReadData(binaryReader, flags, ref numFillBits, ref numLineBits, shapeType); this.Add(styleChange); } } else { //Edge record if ((flags & 0x10) != 0) { //StraightedEdgeRecord StraightEdgeRecord straight = new StraightEdgeRecord(); straight.ReadData(binaryReader, flags); this.Add(straight); } else { //CurvedEdgeRecord CurvedEdgeRecord curved = new CurvedEdgeRecord(); curved.ReadData(binaryReader, flags); this.Add(curved); } } } }
/// <summary> /// Reads the data. /// </summary> /// <param name="binaryReader">Binary reader.</param> /// <param name="shapeType">Shape type.</param> public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType) { binaryReader.SynchBits(); byte numFillBits = (byte)binaryReader.ReadUBits(4); byte numLineBits = (byte)binaryReader.ReadUBits(4); bool readEndShapeRecord = false; while (!readEndShapeRecord) { bool type = binaryReader.ReadBoolean(); byte flags = (byte)binaryReader.ReadUBits(5); if (type == false) { //Non-edge record if (flags == 0) { //EndShapeRecord readEndShapeRecord = true; this.Add(new EndShapeRecord()); if (log.IsInfoEnabled) log.Info("Shape: EndShapeRecord"); } else { //StyleChangerecord StyleChangeRecord styleChange = new StyleChangeRecord(); styleChange.ReadData(binaryReader, flags, ref numFillBits, ref numLineBits, shapeType); this.Add(styleChange); if (log.IsInfoEnabled) log.Info("Shape: StyleChangeRecord"); } } else { //Edge record if ((flags & 0x10) != 0) { //StraightedEdgeRecord StraightEdgeRecord straight = new StraightEdgeRecord(); straight.ReadData(binaryReader, flags); this.Add(straight); if (log.IsInfoEnabled) log.Info("Shape: StraightedEdgeRecord"); } else { //CurvedEdgeRecord CurvedEdgeRecord curved = new CurvedEdgeRecord(); curved.ReadData(binaryReader, flags); this.Add(curved); if (log.IsInfoEnabled) log.Info("Shape: CurvedEdgeRecord"); } } } }