Here you can find the source of decodePayloadFromUtf8(String utf8string)
Parameter | Description |
---|---|
utf8string | a parameter |
public static byte[] decodePayloadFromUtf8(String utf8string)
//package com.java2s; /*// www.j av a 2s .com * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * 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. */ import java.nio.charset.Charset; public class Main { /** * Used for en- & decoding from bytes to String and vice versa. */ protected static final Charset UTF8_CHARSET = Charset.forName("UTF-8"); /** * Helper method that takes an UTF-8 string and returns its byte * representation. * * @param utf8string * @return byte representation */ public static byte[] decodePayloadFromUtf8(String utf8string) { return utf8string.getBytes(UTF8_CHARSET); } }