예제 #1
0
 public override ShortBuffer Put(ShortBuffer src)
 {
     if (src is HeapShortBuffer)
     {
         if (src == this)
         {
             throw new IllegalArgumentException();
         }
         HeapShortBuffer sb = (HeapShortBuffer)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);
 }