Diagonal movement on.
Set up a wall and a water combo as shown:
SSSSS
LLWLL
S = Solid; L = Land; W = Water
Now if Link starts moving diagonally alongside the wall while first pushing against it, he will leave the water, but continue swimming. If he stops moving, he will still be swimming. This stops when he moves in any direction without pushing against the wall. This can happen regardless of which side of the water combo the wall is on.