private void sendRequest() throws IOException { // Build a CONNECT request. String request = buildRequest(); // Convert the request to a byte array. byte[] requestBytes = Misc.getBytesUTF8(request); // Get the stream to send data to the proxy server. OutputStream output = mSocket.getOutputStream(); // Send the request to the proxy server. output.write(requestBytes); output.flush(); }
public void write(String string) throws IOException { // Convert the string into a byte array. byte[] bytes = Misc.getBytesUTF8(string); write(bytes); }
public static String encode(String data) { if (data == null) { return null; } return encode(Misc.getBytesUTF8(data)); }
@Override public byte[] generate() { return Misc.getBytesUTF8(String.valueOf(increment())); }
/** * Set the payload. The given string is converted to a byte array * in UTF-8 encoding. * * <p> * Note that the payload length of a <a href="http://tools.ietf.org/html/rfc6455#section-5.5" * >control frame</a> must be 125 bytes or less. * </p> * * @param payload * The unmasked payload. {@code null} is accepted. * An empty string is treated in the same way as * {@code null}. * * @return * {@code this} object. */ public WebSocketFrame setPayload(String payload) { if (payload == null || payload.length() == 0) { return setPayload((byte[])null); } return setPayload(Misc.getBytesUTF8(payload)); }
byte[] encodedReason = Misc.getBytesUTF8(reason);
byte[] digest = md.digest(Misc.getBytesUTF8(input));
private void sendRequest() throws IOException { // Build a CONNECT request. String request = buildRequest(); // Convert the request to a byte array. byte[] requestBytes = Misc.getBytesUTF8(request); // Get the stream to send data to the proxy server. OutputStream output = mSocket.getOutputStream(); // Send the request to the proxy server. output.write(requestBytes); output.flush(); }
@Override public byte[] generate() { return Misc.getBytesUTF8(String.valueOf(increment())); }
public static String encode(String data) { if (data == null) { return null; } return encode(Misc.getBytesUTF8(data)); }
public void write(String string) throws IOException { // Convert the string into a byte array. byte[] bytes = Misc.getBytesUTF8(string); write(bytes); }
/** * Set the payload. The given string is converted to a byte array * in UTF-8 encoding. * * <p> * Note that the payload length of a <a href="http://tools.ietf.org/html/rfc6455#section-5.5" * >control frame</a> must be 125 bytes or less. * </p> * * @param payload * The unmasked payload. {@code null} is accepted. * An empty string is treated in the same way as * {@code null}. * * @return * {@code this} object. */ public WebSocketFrame setPayload(String payload) { if (payload == null || payload.length() == 0) { return setPayload((byte[])null); } return setPayload(Misc.getBytesUTF8(payload)); }
byte[] encodedReason = Misc.getBytesUTF8(reason);
byte[] digest = md.digest(Misc.getBytesUTF8(input));