Ejemplo n.º 1
0
 public override FloatBuffer Put(FloatBuffer src)
 {
     if (src is HeapFloatBuffer)
     {
         if (src == this)
         {
             throw new IllegalArgumentException();
         }
         HeapFloatBuffer sb = (HeapFloatBuffer)src;
         int             n  = sb.Remaining();
         if (n > Remaining())
         {
             throw new BufferOverflowException();
         }
         System.Array.Copy(sb.Hb, sb.Ix(sb.Position()), Hb, Ix(Position()), n);
         sb.Position(sb.Position() + n);
         Position(Position() + n);
     }
     else if (src.Direct)
     {
         int n = src.Remaining();
         if (n > Remaining())
         {
             throw new BufferOverflowException();
         }
         src.Get(Hb, Ix(Position()), n);
         Position(Position() + n);
     }
     else
     {
         base.Put(src);
     }
     return(this);
 }