273
|
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
|
|
9 import ch.ethz.ssh2.PacketTypeException;
|
|
10
|
|
11 /**
|
|
12 * @author Christian Plattner
|
|
13 * @version $Id: PacketIgnore.java 160 2014-05-01 14:30:26Z dkocher@sudo.ch $
|
|
14 */
|
|
15 public final class PacketIgnore {
|
|
16 private final byte[] payload;
|
|
17
|
|
18 public PacketIgnore(byte[] data) {
|
|
19 TypesWriter tw = new TypesWriter();
|
|
20 tw.writeByte(Packets.SSH_MSG_IGNORE);
|
|
21
|
307
|
22 if (data != null) {
|
273
|
23 tw.writeString(data, 0, data.length);
|
|
24 }
|
|
25 else {
|
|
26 tw.writeString("");
|
|
27 }
|
307
|
28
|
273
|
29 payload = tw.getBytes();
|
|
30 }
|
|
31
|
|
32 public byte[] getPayload() {
|
|
33 return payload;
|
|
34 }
|
|
35 }
|