org.subethamail.smtp.util
Class TextUtils

java.lang.Object
  extended by org.subethamail.smtp.util.TextUtils

public class TextUtils
extends Object

Author:
Jeff Schnitzer

Constructor Summary
TextUtils()
           
 
Method Summary
static byte[] getAsciiBytes(String str)
           
static byte[] getBytes(String str, String charset)
           
static String getStringAscii(byte[] bytes)
          Converts the specified bytes to String using US-ASCII encoding.
static String getStringUtf8(byte[] bytes)
          Converts the specified bytes to String using UTF-8 encoding.
static byte[] getUtf8Bytes(String str)
           
static String joinTogether(Collection<String> items, String delim)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtils

public TextUtils()
Method Detail

joinTogether

public static String joinTogether(Collection<String> items,
                                  String delim)
Returns:
a delimited string containing the specified items

getBytes

public static byte[] getBytes(String str,
                              String charset)
Returns:
the value of str.getBytes() without the idiotic checked exception

getAsciiBytes

public static byte[] getAsciiBytes(String str)
Returns:
the string as US-ASCII bytes

getUtf8Bytes

public static byte[] getUtf8Bytes(String str)
Returns:
the string as UTF-8 bytes

getStringAscii

public static String getStringAscii(byte[] bytes)
Converts the specified bytes to String using US-ASCII encoding.


getStringUtf8

public static String getStringUtf8(byte[] bytes)
Converts the specified bytes to String using UTF-8 encoding.



Copyright © 2006-2012. All Rights Reserved.