本文整理汇总了C#中SwfDotNet.IO.Utils.BufferedBinaryReader.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# BufferedBinaryReader.ReadUInt16方法的具体用法?C# BufferedBinaryReader.ReadUInt16怎么用?C# BufferedBinaryReader.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SwfDotNet.IO.Utils.BufferedBinaryReader
的用法示例。
在下文中一共展示了BufferedBinaryReader.ReadUInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
int tl = System.Convert.ToInt32(rh.TagLength);
characterId = binaryReader.ReadUInt16();
int imgLen = Convert.ToInt32(binaryReader.ReadUInt32());
if (imgLen > 0)
{
jpegData = binaryReader.ReadBytes(imgLen);
alphaData = binaryReader.ReadBytes(tl - 6 - imgLen);
}
}
示例2: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="shapeType">Shape type.</param>
public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
{
base.SetStartPoint(binaryReader);
fillStyleType = binaryReader.ReadByte();
rgbColor = null;
gradientMatrix = null;
bitmapId = 0;
bitmapMatrix = null;
gradient = null;
if (fillStyleType == (byte)FillStyleType.SolidFill)
{
if (shapeType == ShapeType.Shape3)
{
rgbColor = new RGBA();
rgbColor.ReadData(binaryReader);
}
else if (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape)
{
rgbColor = new RGB();
rgbColor.ReadData(binaryReader);
}
}
if (fillStyleType == (byte)FillStyleType.RadialGradientFill ||
fillStyleType == (byte)FillStyleType.LinearGradientFill)
{
gradientMatrix = new Matrix();
gradientMatrix.ReadData(binaryReader);
gradient = new GradientRecordCollection();
gradient.ReadData(binaryReader, shapeType);
}
if (fillStyleType == (byte)FillStyleType.RepeatingBitmapFill ||
fillStyleType == (byte)FillStyleType.ClippedBitmapFill ||
fillStyleType == (byte)FillStyleType.NonSmoothedClippedBitmap ||
fillStyleType == (byte)FillStyleType.NonSmoothedRepeatingBitmap)
{
bitmapId = binaryReader.ReadUInt16();
bitmapMatrix = new Matrix();
bitmapMatrix.ReadData(binaryReader);
}
base.SetEndPoint(binaryReader);
}
示例3: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
characterId = binaryReader.ReadUInt16();
binaryReader.SynchBits();
startBounds = new Rect();
startBounds.ReadData(binaryReader);
binaryReader.SynchBits();
endBounds = new Rect();
endBounds.ReadData(binaryReader);
binaryReader.SynchBits();
offset = binaryReader.ReadUInt32();
morphFillStyles = new MorphFillStyleCollection();
morphFillStyles.ReadData(binaryReader);
morphLineStyles = new MorphLineStyleCollection();
morphLineStyles.ReadData(binaryReader);
ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;
startEdges = new ShapeRecordCollection();
startEdges.ReadData(binaryReader, ShapeType.None);
ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;
endEdges = new ShapeRecordCollection();
endEdges.ReadData(binaryReader, ShapeType.None);
}
示例4: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
fillStyleType = binaryReader.ReadByte();
startColor = null;
endColor = null;
if (fillStyleType == (byte)MorphFillStyleType.SolidFill)
{
startColor = new RGBA();
startColor.ReadData(binaryReader);
endColor = new RGBA();
endColor.ReadData(binaryReader);
}
startGradientMatrix = null;
endGradientMatrix = null;
MorphGradientCollection gradient = null;
if (fillStyleType == (byte)MorphFillStyleType.LinearGradientFill ||
fillStyleType == (byte)MorphFillStyleType.RadialGradientFill)
{
startGradientMatrix = new Matrix();
startGradientMatrix.ReadData(binaryReader);
endGradientMatrix = new Matrix();
endGradientMatrix.ReadData(binaryReader);
gradient = new MorphGradientCollection();
gradient.ReadData(binaryReader);
}
bitmapId = 0;
startBitmapMatrix = null;
endBitmapMatrix = null;
if (fillStyleType == (byte)MorphFillStyleType.RepeatingBitmap ||
fillStyleType == (byte)MorphFillStyleType.ClippedBitmapFill ||
fillStyleType == (byte)MorphFillStyleType.NonSmoothedClippedBitmap ||
fillStyleType == (byte)MorphFillStyleType.NonSmoothedRepeatingBitmap)
{
bitmapId = binaryReader.ReadUInt16();
startBitmapMatrix = new Matrix();
startBitmapMatrix.ReadData(binaryReader);
endBitmapMatrix = new Matrix();
endBitmapMatrix.ReadData(binaryReader);
}
}
示例5: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
long startPosition = binaryReader.BaseStream.Position;
buttonId = binaryReader.ReadUInt16();
binaryReader.ReadUBits(7); //reserved
trackAsMenu = binaryReader.ReadBoolean();
long startPos = binaryReader.BaseStream.Position;
actionOffset = binaryReader.ReadUInt16();
if (characters == null)
characters = new ButtonRecordCollection();
else
characters.Clear();
bool characterEndFlag = false;
while (!characterEndFlag)
{
byte first = binaryReader.ReadByte();
if (first == 0)
characterEndFlag = true;
else
{
ButtonRecord buttRecord = new ButtonRecord();
buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton2);
characters.Add(buttRecord);
}
}
long curr = startPos + actionOffset;
actions = new ButtonCondactionCollection();
bool lastCondAction = false;
if (actionOffset == 0)
lastCondAction = true;
while (!lastCondAction)
{
long readedBytes = binaryReader.BaseStream.Position - startPosition;
ushort condActionSize = binaryReader.ReadUInt16();
if (condActionSize == 0)
{
lastCondAction = true;
condActionSize = (ushort)(rh.TagLength - readedBytes);
}
ButtonCondaction buttCond = new ButtonCondaction();
buttCond.ReadData(binaryReader, condActionSize);
actions.Add(buttCond);
}
}
示例6: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="fontFlagsWideCodes">Font flags wide codes.</param>
public void ReadData(BufferedBinaryReader binaryReader, bool fontFlagsWideCodes)
{
ushort kerningCount = binaryReader.ReadUInt16();
if (kerningCount > 0)
{
for (int i = 0; i < kerningCount; i++)
{
KerningRecord fontKerning = new KerningRecord();
fontKerning.ReadData(binaryReader, fontFlagsWideCodes);
Add(fontKerning);
}
}
}
示例7: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
recursion = binaryReader.ReadUInt16();
timeout = binaryReader.ReadUInt16();
}
示例8: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
fontId = binaryReader.ReadUInt16();
byte fontNameLen = binaryReader.ReadByte();
fontName = binaryReader.ReadString(fontNameLen);
binaryReader.ReadUBits(2); //reserved
fontFlagsSmallText = binaryReader.ReadBoolean();
binaryReader.ReadUBits(2); //not used
fontFlagsItalic = binaryReader.ReadBoolean();
fontFlagsBold = binaryReader.ReadBoolean();
binaryReader.ReadBoolean(); //not used
languageCode = binaryReader.ReadByte();
long codeTableLenght = rh.TagLength - 5 - fontNameLen;
codeTable = null;
codeTable = new ushort[codeTableLenght];
for (int i = 0; i < codeTableLenght / 2; i++)
codeTable[i] = binaryReader.ReadUInt16();
}
示例9: ReadData
/// <summary>
/// Reads the data from a binary file
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
ushort tagCL = binaryReader.ReadUInt16();
tagCode = Convert.ToUInt16(tagCL >> 6);
tagLength = System.Convert.ToUInt32(tagCL - (tagCode << 6));
bool longTag;
if (tagLength == 0x3F)
{
uint len = binaryReader.ReadUInt32();
tagLength = len;
longTag = (tagLength <= 127);
}
else
{
longTag = false;
}
if (tagLength > binaryReader.BaseStream.Length)
{
throw new InvalidTagLengthException();
}
}
示例10: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
fontId = binaryReader.ReadUInt16();
byte fontNameLen = binaryReader.ReadByte();
fontName = binaryReader.ReadString(fontNameLen);
binaryReader.ReadUBits(2); //reserved
fontFlagsSmallText = binaryReader.ReadBoolean();
fontFlagsShiftJIS = binaryReader.ReadBoolean();
fontFlagsAINSI = binaryReader.ReadBoolean();
fontFlagsItalic = binaryReader.ReadBoolean();
fontFlagsBold = binaryReader.ReadBoolean();
fontFlagsWildCodes = binaryReader.ReadBoolean();
uint codeTableLenght = rh.TagLength - 4 - fontNameLen;
if (!fontFlagsWildCodes)
{
codeTable = new uint[codeTableLenght];
for (int i = 0; i < codeTableLenght; i++)
codeTable[i] = (uint)binaryReader.ReadByte();
}
else
{
codeTable = new uint[codeTableLenght / 2];
for (int i = 0; i < codeTableLenght / 2; i++)
codeTable[i] = (uint)binaryReader.ReadUInt16();
}
}
示例11: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
soundId = binaryReader.ReadUInt16();
soundInfo = new SoundInfo();
soundInfo.ReadData(binaryReader);
}
示例12: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
spriteId = binaryReader.ReadUInt16();
int lenght = System.Convert.ToInt32(rh.TagLength-2);
actionRecord = binaryReader.ReadBytes(lenght);
}
示例13: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
buttonId = binaryReader.ReadUInt16();
characters = new ButtonRecordCollection();
bool characterEndFlag = false;
while (!characterEndFlag)
{
byte first = binaryReader.ReadByte();
if (first == 0)
characterEndFlag = true;
else
{
ButtonRecord buttRecord = new ButtonRecord();
buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton);
characters.Add(buttRecord);
}
}
int offset = 2;
foreach (ButtonRecord butRec in characters)
offset += butRec.GetSizeOf();
int lenght = System.Convert.ToInt32(rh.TagLength) - offset - 1;
//-1 for the ActionEndFlag
actions = binaryReader.ReadBytes(lenght);
//Read ActionEndFlag
binaryReader.ReadByte();
}
示例14: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
characterId = binaryReader.ReadUInt16();
rect = new Rect();
rect.ReadData(binaryReader);
BitArray ba = BitParser.GetBitValues(new byte[1]{ binaryReader.ReadByte() });
bool hasText = ba.Get(0); //binaryReader.ReadBoolean();
wordWrap = ba.Get(1); //binaryReader.ReadBoolean();
multiline = ba.Get(2); //binaryReader.ReadBoolean();
password = ba.Get(3); //binaryReader.ReadBoolean();
readOnly = ba.Get(4); //binaryReader.ReadBoolean();
bool hasTextColor = ba.Get(5); //binaryReader.ReadBoolean();
bool hasMaxLength = ba.Get(6); //binaryReader.ReadBoolean();
bool hasFont = ba.Get(7); //binaryReader.ReadBoolean();
//binaryReader.SynchBits();
ba = BitParser.GetBitValues(new byte[1]{ binaryReader.ReadByte() });
//binaryReader.ReadBoolean(); //Reserved
autoSize = ba.Get(1); //binaryReader.ReadBoolean();
bool hasLayout = ba.Get(2); //binaryReader.ReadBoolean();
noSelect = ba.Get(3); //binaryReader.ReadBoolean();
border = ba.Get(4); //binaryReader.ReadBoolean();
//binaryReader.ReadBoolean(); //Reserved
html = ba.Get(6); //binaryReader.ReadBoolean();
usedOutlines = ba.Get(7); //binaryReader.ReadBoolean();
if (hasFont)
{
fontId = binaryReader.ReadUInt16();
fontHeight = binaryReader.ReadUInt16();
}
if (hasTextColor)
{
textColor = new RGBA();
textColor.ReadData(binaryReader);
}
if (hasMaxLength)
maxLenght = binaryReader.ReadUInt16();
if (hasLayout)
{
align = binaryReader.ReadByte();
leftMargin = binaryReader.ReadUInt16();
rightMargin = binaryReader.ReadUInt16();
indent = binaryReader.ReadUInt16();
leading = binaryReader.ReadUInt16();
}
variableName = binaryReader.ReadString();
if (hasText)
initialText = binaryReader.ReadString();
}
示例15: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
characterId = binaryReader.ReadUInt16();
numFrames = binaryReader.ReadUInt16();
width = binaryReader.ReadUInt16();
height = binaryReader.ReadUInt16();
binaryReader.ReadUBits(5);
videoFlagsDeblocking = binaryReader.ReadUBits(2);
videoFlagsSmoothing = binaryReader.ReadBoolean();
codecId = binaryReader.ReadByte();
}