org.apache.james.mailboxmanager.torque
Class MessageUtils
java.lang.Object
org.apache.james.mailboxmanager.torque.MessageUtils
public class MessageUtils
- extends java.lang.Object
Utility methods for messages.
Field Summary |
static byte |
CR
|
static byte |
LF
|
Method Summary |
static long |
countUnnormalLines(byte[] contents)
Counts the number of CR 's and LF 's which
do are part of CRLF s. |
static void |
normalisedWriteTo(byte[] contents,
java.lang.StringBuffer buffer)
Writes bytes into the buffer using naive encoding and converts isolated
LF and CR to CRLF. |
static byte[] |
toByteArray(java.io.InputStream is)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CR
public static final byte CR
- See Also:
- Constant Field Values
LF
public static final byte LF
- See Also:
- Constant Field Values
MessageUtils
public MessageUtils()
countUnnormalLines
public static long countUnnormalLines(byte[] contents)
- Counts the number of
CR
's and LF
's which
do are part of CRLF
s.
- Parameters:
contents
- bytes, not null
- Returns:
- the number of lines which are not normal
CRLF
normalisedWriteTo
public static void normalisedWriteTo(byte[] contents,
java.lang.StringBuffer buffer)
- Writes bytes into the buffer using naive encoding and converts isolated
LF and CR to CRLF.
- Parameters:
contents
- bytes to write, not nullbuffer
- StringBuffer
sink, not null
toByteArray
public static byte[] toByteArray(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.