Example #1
0
    public void CopyByteArray(ref ByteInputStream input, int maxCount)
    {
        int count = input.ReadUInt16();

        GameDebug.Assert(count <= maxCount);

        WriteUInt16((ushort)count);
        input.ReadBytes(m_Buffer, m_CurrentByteIdx, count, maxCount);
        for (int i = count; i < maxCount; i++)
        {
            m_Buffer[m_CurrentByteIdx + i] = 0;
        }
        m_CurrentByteIdx += maxCount;
    }
Example #2
0
    public void CopyByteArray(ref ByteInputStream input, int maxCount)
    {
        var count = (int)input.ReadUInt16();

        WriteUIntPacked((uint)count);
        if (count > 0)
        {
            Align();
            input.ReadBytes(m_Buffer, m_CurrentByteIdx, count, maxCount);
            m_CurrentByteIdx += count;
        }
        else
        {
            input.SkipBytes(maxCount);
        }
    }
Example #3
0
 public void CopyBytes(ref ByteInputStream input, int count)
 {
     input.ReadBytes(m_Buffer, m_CurrentByteIdx, count, count);
     m_CurrentByteIdx += count;
 }