All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.util.mime.CRLF

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

public class CRLF
extends Object
This class provides static methods to convert strings to and from the MIME "canonical" form, in which all line breaks are represented as ASCII CR followed by ASCII LF.

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Author:
Jill Baker

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)
Converts all canonical line breaks with a string (represented by "\r\n") to machine-specific linebreaks.
 o encode(byte[])
Converts all line breaks within a byte array (represented by either "\r", "\n" or "\r\n") to canonical ("\r\n") linebreaks.
 o encode(String)
Converts all line breaks within a string (represented by either "\r", "\n" or "\r\n") to canonical ("\r\n") linebreaks.
 o isProbablyEncoded(byte[])
Tests 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".

Methods

 o encode
 public static String encode(String s)
Converts all line breaks within a string (represented by either "\r", "\n" or "\r\n") to canonical ("\r\n") linebreaks.

Parameters:
s - text to be converted
Returns:
text with canonical line breaks
 o encode
 public static byte[] encode(byte b[])
Converts all line breaks within a byte array (represented by either "\r", "\n" or "\r\n") to canonical ("\r\n") linebreaks.

The byte array can be in ASCII, ISO-Latin-x, UTF8, UTF7, or Quoted-Printable encoding, or any similar character encoding for which CR and LF are represented in the same way as ASCII, and no other bytes can have the values 10 or 13.

Parameters:
b - text to be converted
Returns:
text with canonical line breaks
 o decode
 public static String decode(String s)
Converts 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.

The byte array can be in ASCII, ISO-Latin-x, UTF8, UTF7, or Quoted-Printable encoding, or any similar character encoding for which CR and LF are represented in the same way as ASCII, and no other bytes can have the values 10 or 13.

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[])
Tests whether or not all line breaks within a byte array are of the form "\r\n".

The byte array can be in ASCII, ISO-Latin-x, UTF8, UTF7, or Quoted-Printable encoding, or any similar character encoding for which CR and LF are represented in the same way as ASCII, and no other bytes can have the values 10 or 13.

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