use PrintStream for output, substitute for DataOutputStream.
Merge pull request #1 from karahiyo/feature/add-socket-base

use PrintStream for output, substitute for DataOutputStream.