当前位置: 首页>>代码示例>>C#>>正文


C# ByteBuffer.Position方法代码示例

本文整理汇总了C#中ByteBuffer.Position方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.Position方法的具体用法?C# ByteBuffer.Position怎么用?C# ByteBuffer.Position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ByteBuffer的用法示例。


在下文中一共展示了ByteBuffer.Position方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read

		public int Read (ByteBuffer buffer)
		{
			int offset = buffer.Position () + buffer.ArrayOffset ();
			int num2 = s.Read (buffer.Array (), offset, (buffer.Limit () + buffer.ArrayOffset ()) - offset);
			buffer.Position (buffer.Position () + num2);
			return num2;
		}
开发者ID:renaud91,项目名称:n-metadata-extractor,代码行数:7,代码来源:FileChannel.cs

示例2: Write

		public int Write (ByteBuffer buffer)
		{
			int offset = buffer.Position () + buffer.ArrayOffset ();
			int count = (buffer.Limit () + buffer.ArrayOffset ()) - offset;
			s.Write (buffer.Array (), offset, count);
			buffer.Position (buffer.Position () + count);
			return count;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:8,代码来源:FileChannel.cs

示例3: Set

            public void Set(int size, int type, int stride, ByteBuffer pointer)
            {
                if (stride == 0)
                {
                    switch (type)
                    {
                        case 0x1400:
                        case 0x1401:
                            stride = size;
                            break;

                        case 0x1402:
                            stride = size * 2;
                            break;

                        case 0x1406:
                            stride = size * 4;
                            break;
                    }
                }
                this.size = size;
                this.type = type;
                this.stride = stride;
                this.pointer = pointer;
                this.pos = pointer.Position();
            }
开发者ID:ordanielcmessias,项目名称:LGame,代码行数:26,代码来源:GL.cs

示例4: WriteHeader

        /// <summary>
        /// Writes MAT-file header into <c>Stream</c>
        /// </summary>
        /// <param name="stream">The output stream</param>
        private void WriteHeader( BinaryWriter stream )
        {
            //write descriptive text
            MatFileHeader header = MatFileHeader.CreateHeader();
            char[] dest = new char[116];
            char[] src = header.Description.ToCharArray();
            Array.Copy( src, 0, dest, 0, src.Length );

            byte[] endianIndicator = header.EndianIndicator;

            //ByteBuffer buf = new ByteBuffer( dest.Length * 2 + /* char size */ + 2 + endianIndicator.Length );
            ByteBuffer buf = new ByteBuffer(128); // The header is always a 128-byte header

            for( int i = 0; i < dest.Length; i++ )
            {
                buf.Put( (byte)dest[i] );
            }
            //write subsyst data offset
            buf.Position( buf.Position() + 8 );

            // write version
            int version = header.Version;
            //buf.Put( (byte)(version >> 8) );
            //buf.Put( (byte)version );
            buf.PutShort((short)version);

            buf.Put( endianIndicator );

            stream.Write( buf.Array() );
        }
开发者ID:patrickmaster,项目名称:electre-tri,代码行数:34,代码来源:MatFileWriter.cs

示例5: CompactByteBuffer

 // 渡されたByteBufferを切り诘めた、新しいByteBufferを作る
 private ByteBuffer CompactByteBuffer(ByteBuffer b)
 {
     int count = b.Position();
     ByteBuffer ret = ByteBuffer.Allocate(count);
     b.Position(0);
     for (int i = 0; i < count; i++)
     {
         ret.Put(b.Get());
     }
     ret.Position(0);
     return ret;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:13,代码来源:LexicalAnalyzer.cs


注:本文中的ByteBuffer.Position方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。