Class cryptix.mime.CRLF
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.mime.CRLF

java.lang.Object
   |
   +----cryptix.mime.CRLF

public class CRLF
extends Object
This class provides static functions to convert strings to and from the "canonical" form in which all line breaks are represented as ASCII CR followed by ASCII LF.
Author:
Jill Baker

Constructor Index

 o CRLF()

Method Index

 o decode(byte[])
Convert all canonical line breaks with a byte array (represented by "\r\n" to machine-specific linebreaks.
 o decode(String)
Convert all canonical line breaks with a string (represented by "\r\n" to machine-specific linebreaks.
 o encode(byte[])
Convert all line breaks within a byte array (represented by either '\r', '\n' or '\r\n') to canonical ('\r\n') linebreaks.
 o encode(String)
Convert all line breaks within a string (represented by either '\r', '\n' or '\r\n') to canonical ('\r\n') linebreaks.
 o isProbablyEncoded(byte[])
Test whether or not all line breaks within a byte array are of the form "\r\n".
 o isProbablyEncoded(String)
Test whether or not all line breaks within a String are of the form "\r\n".

Constructors

 o CRLF
  public CRLF()

Methods

 o encode
  public static String encode(String s)
Convert all line breaks within a string (represented by either '\r', '\n' or '\r\n') to canonical ('\r\n') linebreaks.
Parameters:
s - text to be encoded
Returns:
text with canonical line breaks
 o encode
  public static byte[] encode(byte b[])
Convert all line breaks within a byte array (represented by either '\r', '\n' or '\r\n') to canonical ('\r\n') linebreaks.
Parameters:
b - text to be encoded
Returns:
text with canonical line breaks
 o decode
  public static String decode(String s)
Convert all canonical line breaks with a string (represented by "\r\n" to machine-specific linebreaks.
Parameters:
s - text (with canonical line breaks) to be decoded
Returns:
text with machine-specific line breaks
 o decode
  public static byte[] decode(byte b[])
Convert all canonical line breaks with a byte array (represented by "\r\n" to machine-specific linebreaks.
Parameters:
b - text (with canonical line breaks) to be decoded
Returns:
text with machine-specific line breaks
 o isProbablyEncoded
  public static boolean isProbablyEncoded(String s)
Test whether or not all line breaks within a String are of the form "\r\n".
Parameters:
s - String to be tested.
Returns:
true if all line breaks are of the form "\r\n".
 o isProbablyEncoded
  public static boolean isProbablyEncoded(byte b[])
Test whether or not all line breaks within a byte array are of the form "\r\n".
Parameters:
b - byte array to be tested.
Returns:
true if all line breaks are of the form "\r\n".

All Packages  Class Hierarchy  This Package  Previous  Next  Index