예제 #1
0
 public ByteBuffer( int size, ByteOrder order )
     : base(size)
 {
     SetOrder ( order );
 }
예제 #2
0
 public static ByteBuffer Wrap( byte[] buf, ByteOrder order )
 {
     return new ByteBuffer ( buf, order );
 }
예제 #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;
        }
예제 #4
0
 ///////////////////////////////////////////////////////////////////////
 /// Constructor
 ///////////////////////////////////////////////////////////////////////
 //private ByteBuffer( byte[] buf ) : this( buf, ByteOrder.LITTLE_ENDIAN )
 //{
 //}
 public ByteBuffer( byte[] buf, ByteOrder order )
     : base(buf)
 {
     SetOrder ( order );
 }
예제 #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 );
 }
예제 #6
0
 public ByteBuffer(int size, ByteOrder order)
     : base(size)
 {
     SetOrder(order);
 }
예제 #7
0
        ///////////////////////////////////////////////////////////////////////
        /// Constructor
        ///////////////////////////////////////////////////////////////////////

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

        public ByteBuffer(byte[] buf, ByteOrder order)
            : base(buf)
        {
            SetOrder(order);
        }
예제 #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));
 }
예제 #9
0
 public static ByteBuffer Wrap(byte[] buf, ByteOrder order)
 {
     return(new ByteBuffer(buf, order));
 }