Class Utils

  • public final class Utils
    extends Object
    Internal utility methods.
    • Method Detail

      • tokenize

        public static List<String> tokenize​(char separator,
                                            String quoteChars,
                                            boolean includeEmptyTokens,
                                            String text)
        Tokenize provide text by separator char respecting quoted sub-sequences. Quoted sub-sequences are parts of text which starts and ends by the same quoteChar.
        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 with length == 0.
        text - a text to be tokenized.
        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.
        out - the stream where to append the byte buffer
        byteBuffer - the byte buffer to append to the stream
        IOException - in case of an IO problem