Here you can find the source of utf8BufferByteLen(CharSequence str)
public static int utf8BufferByteLen(CharSequence str)
//package com.java2s; //License from project: Apache License public class Main { public static final int UTF8_MAX_BYTES_PER_CHAR = 3; public static int utf8BufferByteLen(CharSequence str) { return str.length() * UTF8_MAX_BYTES_PER_CHAR; }//from w w w . java 2s. co m }