// Path: src/main/java/sockslib/common/methods/SocksMethod.java
// public interface SocksMethod {
// 
//   /**
//    * method byte.
//    *
//    * @return byte.
//    */
//   int getByte();
// 
//   /**
//    * Gets method's name.
//    *
//    * @return Name of the method.
//    */
//   String getMethodName();
// 
//   /**
//    * Do method job. This method will be called by SOCKS client.
//    *
//    * @param socksProxy SocksProxy instance.
//    * @throws SocksException If there are any errors about SOCKS protocol.
//    * @throws IOException    if there are any IO errors.
//    */
//   void doMethod(SocksProxy socksProxy) throws SocksException, IOException;
// 
//   /**
//    * Do method job. This method will be called by SOCKS server.
//    *
//    * @param session Session.
//    * @throws SocksException TODO
//    * @throws IOException    TODO
//    */
//   void doMethod(Session session) throws SocksException, IOException;
// 
// }


import sockslib.common.methods.SocksMethod;
/*
 * Copyright 2015-2025 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package sockslib.server.msg;



/**
 * The class <code>MethodSelectionResponseMessage</code> represents response message for method
 * selection message. This message is always sent by SOCKS server.
 *
 * @author Youchao Feng
 * @version 1.0
 * @date Apr 6, 2015 11:10:05 AM
 */
public class MethodSelectionResponseMessage implements WritableMessage {

  /**
   * Version. 5 is default.
   */
  private int version = 5;

  /**
   * Selected method. 0xFF is default.
   */
  private int method = 0xFF;


  /**
   * Constructs an instance of {@link MethodSelectionResponseMessage}
   */
  public MethodSelectionResponseMessage() {

  }

  /**
   * Constructs an instance of {@link MethodSelectionResponseMessage} with a method.
   *
   * @param socksMethod Selected method.
   */
// Path: src/main/java/sockslib/common/methods/SocksMethod.java
// public interface SocksMethod {
// 
//   /**
//    * method byte.
//    *
//    * @return byte.
//    */
//   int getByte();
// 
//   /**
//    * Gets method's name.
//    *
//    * @return Name of the method.
//    */
//   String getMethodName();
// 
//   /**
//    * Do method job. This method will be called by SOCKS client.
//    *
//    * @param socksProxy SocksProxy instance.
//    * @throws SocksException If there are any errors about SOCKS protocol.
//    * @throws IOException    if there are any IO errors.
//    */
//   void doMethod(SocksProxy socksProxy) throws SocksException, IOException;
// 
//   /**
//    * Do method job. This method will be called by SOCKS server.
//    *
//    * @param session Session.
//    * @throws SocksException TODO
//    * @throws IOException    TODO
//    */
//   void doMethod(Session session) throws SocksException, IOException;
// 
// }


// Path: src/main/java/sockslib/server/msg/MethodSelectionResponseMessage.java
import sockslib.common.methods.SocksMethod;

/*
 * Copyright 2015-2025 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package sockslib.server.msg;



/**
 * The class <code>MethodSelectionResponseMessage</code> represents response message for method
 * selection message. This message is always sent by SOCKS server.
 *
 * @author Youchao Feng
 * @version 1.0
 * @date Apr 6, 2015 11:10:05 AM
 */
public class MethodSelectionResponseMessage implements WritableMessage {

  /**
   * Version. 5 is default.
   */
  private int version = 5;

  /**
   * Selected method. 0xFF is default.
   */
  private int method = 0xFF;


  /**
   * Constructs an instance of {@link MethodSelectionResponseMessage}
   */
  public MethodSelectionResponseMessage() {

  }

  /**
   * Constructs an instance of {@link MethodSelectionResponseMessage} with a method.
   *
   * @param socksMethod Selected method.
   */
  public MethodSelectionResponseMessage(SocksMethod socksMethod) {