}
private void writeSessionId(final ChannelAssociation channelAssociation, final short invocationId, final SessionID sessionID, final Affinity hardAffinity) throws IOException {
final byte[] sessionIdBytes = sessionID.getEncodedForm();
final DataOutputStream dataOutputStream;
final MessageOutputStream messageOutputStream;
try {
messageOutputStream = channelAssociation.acquireChannelMessageOutputStream();
} catch (Exception e) {
throw EjbMessages.MESSAGES.failedToOpenMessageOutputStream(e);
}