Yes, copperheads can definitely swim and do so frequently. If it raised up and opened its mouth, it sounds like it could have been a cottonmouth. They will often do that and the inside of their mouth is white, hence the name. Cottonmouths can be brownish at times and the smaller ones have much more visible patterns.

One thing about poisonous snakes is the the way they swim. They will be on top of the water, like a balloon, rather than in the water if that makes sense.