public class UsernamePasswordMessage extends Object implements ReadableMessage, WritableMessage
UsernamePasswordMessage
represents a USERNAME/PASSWROD authentication
message.Constructor and Description |
---|
UsernamePasswordMessage()
Constructs an instance of
UsernamePasswordMessage . |
UsernamePasswordMessage(String username,
String password) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Returns the byte array of the message.
|
int |
getLength()
Returns the length of message.
|
String |
getPassword()
Returns password.
|
String |
getUsername()
Returns username.
|
UsernamePasswordCredentials |
getUsernamePasswordCredentials()
Returns an instance of
UsernamePasswordCredentials . |
int |
getVersion()
Returns version.
|
void |
read(InputStream inputStream)
Read message from a input stream.
|
void |
setPassword(String password)
Sets password.
|
void |
setUsername(String username)
Sets username.
|
public UsernamePasswordMessage()
UsernamePasswordMessage
.public byte[] getBytes()
WritableMessage
getBytes
in interface WritableMessage
public int getLength()
Message
public void read(InputStream inputStream) throws SocksException, IOException
ReadableMessage
read
in interface ReadableMessage
inputStream
- Input stream.SocksException
- If a SOCKS protocol error occurred.IOException
- If an I/O error occurred.public int getVersion()
public String getUsername()
public void setUsername(String username)
username
- Username.public String getPassword()
public void setPassword(String password)
password
- Password.public UsernamePasswordCredentials getUsernamePasswordCredentials()
UsernamePasswordCredentials
.UsernamePasswordCredentials
.Copyright © 2015. All rights reserved.