public void encodeAsByteBuf(ByteBuf var1) { var1.writeByte(this.protocolVersion().byteValue()); var1.writeByte(this.cmdType.byteValue()); var1.writeByte(0); var1.writeByte(this.addressType.byteValue()); switch (SocksCmdRequest.SyntheticClass_1 .$SwitchMap$io$netty$handler$codec$socks$SocksAddressType[this.addressType.ordinal()]) { case 1: var1.writeBytes(NetUtil.createByteArrayFromIpAddressString(this.host)); var1.writeShort(this.port); break; case 2: var1.writeByte(this.host.length()); var1.writeBytes(this.host.getBytes(CharsetUtil.US_ASCII)); var1.writeShort(this.port); break; case 3: var1.writeBytes(NetUtil.createByteArrayFromIpAddressString(this.host)); var1.writeShort(this.port); } }
public SocksCmdRequest(SocksCmdType var1, SocksAddressType var2, String var3, int var4) { super(SocksRequestType.CMD); if (var1 == null) { throw new NullPointerException("cmdType"); } else if (var2 == null) { throw new NullPointerException("addressType"); } else if (var3 == null) { throw new NullPointerException("host"); } else { switch (SocksCmdRequest.SyntheticClass_1 .$SwitchMap$io$netty$handler$codec$socks$SocksAddressType[var2.ordinal()]) { case 1: if (!NetUtil.isValidIpV4Address(var3)) { throw new IllegalArgumentException(var3 + " is not a valid IPv4 address"); } break; case 2: if (IDN.toASCII(var3).length() > 255) { throw new IllegalArgumentException( var3 + " IDN: " + IDN.toASCII(var3) + " exceeds 255 char limit"); } break; case 3: if (!NetUtil.isValidIpV6Address(var3)) { throw new IllegalArgumentException(var3 + " is not a valid IPv6 address"); } case 4: } if (var4 > 0 && var4 < 65536) { this.cmdType = var1; this.addressType = var2; this.host = IDN.toASCII(var3); this.port = var4; } else { throw new IllegalArgumentException(var4 + " is not in bounds 0 < x < 65536"); } } }