Package io.helidon.common.http
Class Utils
- java.lang.Object
-
- io.helidon.common.http.Utils
-
public final class Utils extends Object
Internal utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>tokenize(char separator, String quoteChars, boolean includeEmptyTokens, String text)Tokenize providetextbyseparatorchar respecting quoted sub-sequences.static voidwrite(ByteBuffer byteBuffer, OutputStream out)Appends the content of the given byte buffer into the given output stream.
-
-
-
Method Detail
-
tokenize
public static List<String> tokenize(char separator, String quoteChars, boolean includeEmptyTokens, String text)
Tokenize providetextbyseparatorchar respecting quoted sub-sequences. Quoted sub-sequences are parts oftextwhich starts and ends by the samequoteChar.- Parameters:
separator- a token separator.quoteChars- characters which can be used for quoting. Quoted part must start and ends with the same character.includeEmptyTokens- return also tokens withlength == 0.text- a text to be tokenized.- Returns:
- A list of tokens without separator characters.
-
write
public static void write(ByteBuffer byteBuffer, OutputStream out) throws IOException
Appends the content of the given byte buffer into the given output stream.- Parameters:
out- the stream where to append the byte bufferbyteBuffer- the byte buffer to append to the stream- Throws:
IOException- in case of an IO problem
-
-