Example #1
0
 public ByteBuffer( int size, ByteOrder order )
     : base(size)
 {
     SetOrder ( order );
 }
Example #2
0
 public static ByteBuffer Wrap( byte[] buf, ByteOrder order )
 {
     return new ByteBuffer ( buf, order );
 }
Example #3
0
        public ByteBuffer SetOrder( ByteOrder order )
        {
            this.order = order;

            // Both reader and writer work on the same back store: MemoryStream
            if ( order == ByteOrder.LITTLE_ENDIAN ) {
                reader = new BinaryReader ( this );
                writer = new BinaryWriter ( this );
            } else {
                reader = new BEBinaryReader ( this );
                writer = new BEBinaryWriter ( this );
            }
            return this;
        }
Example #4
0
 ///////////////////////////////////////////////////////////////////////
 /// Constructor
 ///////////////////////////////////////////////////////////////////////
 //private ByteBuffer( byte[] buf ) : this( buf, ByteOrder.LITTLE_ENDIAN )
 //{
 //}
 public ByteBuffer( byte[] buf, ByteOrder order )
     : base(buf)
 {
     SetOrder ( order );
 }
Example #5
0
 public static ByteBuffer Wrap( byte[] buf, int offset, int len, ByteOrder order )
 {
     byte[] newBuf = new byte[len];
     Array.Copy ( buf, offset, newBuf, 0, len );
     return new ByteBuffer ( newBuf, order );
 }
Example #6
0
 public ByteBuffer(int size, ByteOrder order)
     : base(size)
 {
     SetOrder(order);
 }
Example #7
0
        ///////////////////////////////////////////////////////////////////////
        /// Constructor
        ///////////////////////////////////////////////////////////////////////

        //private ByteBuffer( byte[] buf ) : this( buf, ByteOrder.LITTLE_ENDIAN )
        //{
        //}

        public ByteBuffer(byte[] buf, ByteOrder order)
            : base(buf)
        {
            SetOrder(order);
        }
Example #8
0
 public static ByteBuffer Wrap(byte[] buf, int offset, int len, ByteOrder order)
 {
     byte[] newBuf = new byte[len];
     Array.Copy(buf, offset, newBuf, 0, len);
     return(new ByteBuffer(newBuf, order));
 }
Example #9
0
 public static ByteBuffer Wrap(byte[] buf, ByteOrder order)
 {
     return(new ByteBuffer(buf, order));
 }