Deprecate SocksMessage.encodeAsByteBuf()

It was an internal use only method which became public by a mistake
during the review process.
This commit is contained in:
Trustin Lee 2014-06-24 16:40:44 +09:00
parent 71dce0193f
commit 7457801020
3 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ public class SocksCmdRequestDecoder extends ReplayingDecoder<SocksCmdRequestDeco
protected void decode(ChannelHandlerContext ctx, ByteBuf byteBuf, List<Object> out) throws Exception {
switch (state()) {
case CHECK_PROTOCOL_VERSION: {
version = SocksProtocolVersion.fromByte(byteBuf.readByte());
version = SocksProtocolVersion.valueOf(byteBuf.readByte());
if (version != SocksProtocolVersion.SOCKS5) {
break;
}

View File

@ -55,7 +55,8 @@ public abstract class SocksMessage {
}
/**
* Encode socks message into its byte representation and write it into byteBuf
* @deprecated Do not use; this method was intended for an internal use only.
*/
@Deprecated
public abstract void encodeAsByteBuf(ByteBuf byteBuf);
}

View File

@ -39,6 +39,7 @@ public class SocksMessageEncoder extends MessageToByteEncoder<SocksMessage> {
}
@Override
@SuppressWarnings("deprecation")
protected void encode(ChannelHandlerContext ctx, SocksMessage msg, ByteBuf out) throws Exception {
msg.encodeAsByteBuf(out);
}