comparison app/src/main/java/ch/ethz/ssh2/packets/PacketSessionExecCommand.java @ 438:d29cce60f393

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 11:23:55 -0800
parents src/ch/ethz/ssh2/packets/PacketSessionExecCommand.java@91a31873c42a
children
comparison
equal deleted inserted replaced
437:208b31032318 438:d29cce60f393
1 /*
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved.
3 * Please refer to the LICENSE.txt for licensing details.
4 */
5 package ch.ethz.ssh2.packets;
6
7 import java.io.IOException;
8 import java.io.UnsupportedEncodingException;
9
10 /**
11 * @author Christian Plattner
12 * @version $Id: PacketSessionExecCommand.java 160 2014-05-01 14:30:26Z dkocher@sudo.ch $
13 */
14 public final class PacketSessionExecCommand {
15 private final byte[] payload;
16
17 public PacketSessionExecCommand(int recipientChannelID, boolean wantReply, String command, String charsetName) throws UnsupportedEncodingException {
18 TypesWriter tw = new TypesWriter();
19 tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
20 tw.writeUINT32(recipientChannelID);
21 tw.writeString("exec");
22 tw.writeBoolean(wantReply);
23 tw.writeString(command, charsetName);
24 payload = tw.getBytes();
25 }
26
27 public byte[] getPayload() throws IOException {
28 return payload;
29 }
30 }