本文整理汇总了C#中SwfDotNet.IO.Utils.BufferedBinaryReader类的典型用法代码示例。如果您正苦于以下问题:C# BufferedBinaryReader类的具体用法?C# BufferedBinaryReader怎么用?C# BufferedBinaryReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BufferedBinaryReader类属于SwfDotNet.IO.Utils命名空间,在下文中一共展示了BufferedBinaryReader类的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);
Meta = binaryReader.ReadString();
}
示例2: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public override void ReadData(BufferedBinaryReader binaryReader)
{
uint pictureStartCode = binaryReader.ReadUBits(17);
uint version = binaryReader.ReadUBits(5);
uint temporalRef = binaryReader.ReadUBits(8);
//TODO...
}
示例3: ReadData
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
base.ReadData(version, binaryReader);
Type = (FlvScriptType)binaryReader.ReadUBits(8);
int count = 0;
if (Type == FlvScriptType.Number)
count = 8;
for (int i = 0; i < count; i++)
{
binaryReader.ReadByte();
}
}
示例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>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="shapeType">Shape type.</param>
public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
{
int count = 0;
byte fillStyleCount = binaryReader.ReadByte();
count = System.Convert.ToInt32(fillStyleCount);
ushort fillStyleCountExtended = 0;
if (fillStyleCount == 0xFF && (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape3))
{
fillStyleCountExtended = binaryReader.ReadUInt16();
count = System.Convert.ToInt32(fillStyleCountExtended);
}
if (count != 0)
{
for (int i = 0; i < count; i++)
{
byte fillStyleType = binaryReader.PeekByte();
FillStyle fillStyle = GetFillStyleFromType(fillStyleType);
if (fillStyle != null)
{
fillStyle.ReadData(binaryReader, shapeType);
this.Add(fillStyle);
}
}
}
}
示例6: ReadData
/// <summary>
/// Reads the data for the swf decompilation.
/// </summary>
/// <param name="version">Version.</param>
/// <param name="binaryReader">Binary reader.</param>
public virtual void ReadData(byte version, BufferedBinaryReader binaryReader)
{
}
示例7: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="flags">Flags.</param>
public void ReadData(BufferedBinaryReader binaryReader, byte flags)
{
base.SetStartPoint(binaryReader);
byte numBits = (byte)(flags & 0x0F);
bool generalLineFLag = binaryReader.ReadBoolean();
deltaX = 0;
deltaY = 0;
if (generalLineFLag)
{
deltaX = binaryReader.ReadSBits((uint)(numBits + 2));
deltaY = binaryReader.ReadSBits((uint)(numBits + 2));
}
else
{
bool vertLineFlag = binaryReader.ReadBoolean();
if (!vertLineFlag)
deltaX = binaryReader.ReadSBits((uint)(numBits + 2));
else
deltaY = binaryReader.ReadSBits((uint)(numBits + 2));
}
base.SetEndPoint(binaryReader);
}
示例8: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="version">Version.</param>
/// <param name="binaryReader">Binary reader.</param>
public virtual void ReadData(byte version, BufferedBinaryReader binaryReader)
{
this.tagType = (FlvTagCodeEnum)binaryReader.ReadByte();
this.dataSize = binaryReader.ReadUBits(24);
this.timeStamp = binaryReader.ReadUBits(24);
binaryReader.ReadUInt32();
}
示例9: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
byte numGradients = binaryReader.ReadByte();
for (int i = 0; i < numGradients; i++)
{
MorphGradRecord morph = new MorphGradRecord();
morph.ReadData(binaryReader);
this.Add(morph);
}
}
示例10: Init
/// <summary>
/// Inits the stream reading process.
/// </summary>
/// <param name="path">Path.</param>
/// <param name="useBuffer">Use buffer.</param>
private void Init(string path, bool useBuffer)
{
Stream stream = File.OpenRead(path);
if (useBuffer)
{
FileInfo fi = new FileInfo(path);
byte[] buff = new byte[fi.Length];
stream.Read(buff, 0, System.Convert.ToInt32(fi.Length));
stream.Close();
MemoryStream ms = new MemoryStream(buff);
this.br = new BufferedBinaryReader(ms, false);
}
else
{
this.br = new BufferedBinaryReader(stream, false);
}
}
示例11: FlvReader
/// <summary>
/// Creates a new <see cref="FlvReader"/> instance.
/// </summary>
/// <param name="stream">Stream.</param>
public FlvReader(Stream stream)
{
this.br = new BufferedBinaryReader(stream, false);
}
示例12: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="numGlyphs">Num glyphs.</param>
public void ReadData(BufferedBinaryReader binaryReader, ushort numGlyphs)
{
Clear();
for (int i = 0; i < numGlyphs; i++)
{
binaryReader.SynchBits();
Rect fontBound = new Rect();
fontBound.ReadData(binaryReader);
Add(fontBound);
}
}
示例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);
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);
}
示例14: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
base.SetStartPoint(binaryReader);
binaryReader.SynchBits();
bool hasScale = binaryReader.ReadBoolean();
if (hasScale)
{
uint nScaleBits = binaryReader.ReadUBits(5);
matrix[0, 0] = binaryReader.ReadFloat(nScaleBits);
matrix[1, 1] = binaryReader.ReadFloat(nScaleBits);
}
bool hasRotate = binaryReader.ReadBoolean();
if (hasRotate)
{
uint nRotateBits = binaryReader.ReadUBits(5);
matrix[1, 0] = binaryReader.ReadFloat(nRotateBits);
matrix[0, 1] = binaryReader.ReadFloat(nRotateBits);
}
uint nTranslateBits = binaryReader.ReadUBits(5);
matrix[0, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
matrix[1, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
binaryReader.SynchBits();
base.SetEndPoint(binaryReader);
}
示例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);
soundId = binaryReader.ReadUInt16();
soundFormat = binaryReader.ReadUBits(4);
soundRate = binaryReader.ReadUBits(2);
soundSize = binaryReader.ReadUBits(1);
soundType = binaryReader.ReadUBits(1);
soundSampleCount = binaryReader.ReadUInt32();
uint size = rh.TagLength - 2 - 1 - 4;
soundData = new byte[size];
for (uint i = 0; i < size; i++)
soundData[i] = binaryReader.ReadByte();
}