* @return the target channel
* @throws IOException if the channel does not exists
*/
protected Channel getChannel(Buffer buffer) throws IOException {
int recipient = buffer.getInt();
Channel channel = channels.get(recipient);
if (channel == null) {
buffer.rpos(buffer.rpos() - 5);
SshConstants.Message cmd = buffer.getCommand();
throw new SshException("Received " + cmd + " on unknown channel " + recipient);
}