/** {@inheritDoc} */
@Override
public void encode(OutputStream os, Object obj) throws Exception {
OutputStreamWriter osw = new OutputStreamWriter(os, Constants.SC_CHARACTER_SET);
BufferedWriter bw = new BufferedWriter(osw);
SCMPKeepAlive keepAlive = (SCMPKeepAlive) obj;
if (keepAlive.isReply()) {
SCMPHeaderKey headerKey = SCMPHeaderKey.KRS;
writeHeadLine(bw, headerKey, 0, 0);
} else {
SCMPHeaderKey headerKey = SCMPHeaderKey.KRQ;
writeHeadLine(bw, headerKey, 0, 0);