Maybe you could clarify you question. Do you just want to send a file in a convenient way? Then I'd strongly recommend some standard protocol, such as SSH File Transfer Protocol. This is much preferrable to using some home-grown code, allows you to use existing solid libraries and makes interoperability with other software easier.
Since you asked specifically about a socket channel program: Is this a homework question? In that case I'd advise you to read the Javadocs for the SocketChannel class, and google a bit for example code using it. If you then still have a problem, post another question with the specific thing you don't understand, and we'll probably help :-).