本文整理汇总了C#中SwfDotNet.IO.Utils.BufferedBinaryReader.ReadUBits方法的典型用法代码示例。如果您正苦于以下问题:C# BufferedBinaryReader.ReadUBits方法的具体用法?C# BufferedBinaryReader.ReadUBits怎么用?C# BufferedBinaryReader.ReadUBits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SwfDotNet.IO.Utils.BufferedBinaryReader
的用法示例。
在下文中一共展示了BufferedBinaryReader.ReadUBits方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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...
}
示例2: 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();
}
}
示例3: 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);
}
示例4: ReadData
/// <summary>
/// Reads the data from a binary file
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
base.SetStartPoint(binaryReader);
uint nBits = binaryReader.ReadUBits(5);
xMin = binaryReader.ReadSBits(nBits);
xMax = binaryReader.ReadSBits(nBits);
yMin = binaryReader.ReadSBits(nBits);
yMax = binaryReader.ReadSBits(nBits);
base.SetEndPoint(binaryReader);
}
示例5: 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();
}
示例6: 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();
}
示例7: 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)
{
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");
}
}
}
}
示例8: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="flags">Flags.</param>
/// <param name="numFillBits">Num fill bits.</param>
/// <param name="numLineBits">Num line bits.</param>
/// <param name="shapeType">Shape type.</param>
public void ReadData(BufferedBinaryReader binaryReader, byte flags,
ref byte numFillBits, ref byte numLineBits, ShapeType shapeType)
{
base.SetStartPoint(binaryReader);
bool stateNewStyle = ((flags & 0x10) != 0);
bool stateLineStyle = ((flags & 0x08) != 0);
bool stateFillStyle1 = ((flags & 0x04) != 0);
bool stateFillStyle0 = ((flags & 0x02) != 0);
bool stateMoveTo = ((flags & 0x01) != 0);
if (stateMoveTo)
{
uint bits = binaryReader.ReadUBits(5);
moveDeltaX = binaryReader.ReadSBits(bits);
moveDeltaY = binaryReader.ReadSBits(bits);
}
if (stateFillStyle0)
{
fillStyle0 = (int)binaryReader.ReadUBits(numFillBits);
}
if (stateFillStyle1)
{
fillStyle1 = (int)binaryReader.ReadUBits(numFillBits);
}
if (stateLineStyle)
{
lineStyle = (int)binaryReader.ReadUBits(numLineBits);
}
fillStyles = null;
lineStyles = null;
if (stateNewStyle)
{
fillStyles = new FillStyleCollection();
fillStyles.ReadData(binaryReader, shapeType);
lineStyles = new LineStyleCollection();
lineStyles.ReadData(binaryReader, shapeType);
numFillBits = (byte)binaryReader.ReadUBits(4);
numLineBits = (byte)binaryReader.ReadUBits(4);
}
base.SetEndPoint(binaryReader);
}
示例9: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="reader">Reader.</param>
public void ReadData(BufferedBinaryReader reader)
{
this.signature = reader.ReadString(3);
this.version = reader.ReadByte();
reader.ReadUBits(5);
this.hasAudio = reader.ReadBoolean();
reader.ReadBoolean();
this.hasVideo = reader.ReadBoolean();
reader.ReadUInt32();
}
示例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();
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();
}
示例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);
binaryReader.ReadUBits(4);
playbackSoundRate = binaryReader.ReadUBits(2);
playbackSoundSize = binaryReader.ReadUBits(1);
playbackSoundType = binaryReader.ReadUBits(1);
streamSoundCompression = binaryReader.ReadUBits(4);
streamSoundRate = binaryReader.ReadUBits(2);
streamSoundSize = binaryReader.ReadUBits(1);
streamSoundType = binaryReader.ReadUBits(1);
streamSoundSampleCount = binaryReader.ReadUInt16();
latencySeek = 0;
if (streamSoundCompression == 2)
latencySeek = binaryReader.ReadInt16();
}
示例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);
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();
}
}
示例13: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="version">Version.</param>
/// <param name="binaryReader">Binary reader.</param>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
base.ReadData(version, binaryReader);
this.soundFormat = (FlvSoundFormat)binaryReader.ReadUBits(4);
this.soundRate = binaryReader.ReadUBits(2);
this.isSnd16Bits = binaryReader.ReadBoolean();
this.isStereo = binaryReader.ReadBoolean();
uint dataLenght = this.dataSize - 1;
if (dataLenght > 0)
{
this.soundData = new byte[dataLenght];
for (int i = 0; i < dataLenght; i++)
this.soundData[i] = binaryReader.ReadByte();
}
}
示例14: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
hasAddTerms = binaryReader.ReadBoolean();
hasMultTerms = binaryReader.ReadBoolean();
uint nBits = binaryReader.ReadUBits(4);
if (hasMultTerms)
{
int redMultTerms = binaryReader.ReadSBits(nBits);
int greenMultTerms = binaryReader.ReadSBits(nBits);
int blueMultTerms = binaryReader.ReadSBits(nBits);
}
if (hasAddTerms)
{
int redAddTerms = binaryReader.ReadSBits(nBits);
int greenAddTerms = binaryReader.ReadSBits(nBits);
int blueAddTerms = binaryReader.ReadSBits(nBits);
}
}
示例15: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
bool hasAddTerms = binaryReader.ReadBoolean();
bool hasMultTerms = binaryReader.ReadBoolean();
uint nBits = binaryReader.ReadUBits(4);
if (hasMultTerms)
{
redMultTerms = binaryReader.ReadSBits(nBits);
greenMultTerms = binaryReader.ReadSBits(nBits);
blueMultTerms = binaryReader.ReadSBits(nBits);
alphaMultTerms = binaryReader.ReadSBits(nBits);
}
if (hasAddTerms)
{
redAddTerms = binaryReader.ReadSBits(nBits);
greenAddTerms = binaryReader.ReadSBits(nBits);
blueAddTerms = binaryReader.ReadSBits(nBits);
alphaAddTerms = binaryReader.ReadSBits(nBits);
}
}