|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.util.mime.CRLF
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 $
Method Summary | |
static byte[] |
decode(byte[] b)
Convert all canonical line breaks with a byte array (represented by "\r\n") to machine-specific linebreaks. |
static java.lang.String |
decode(java.lang.String s)
Converts all canonical line breaks with a string (represented by "\r\n") to machine-specific linebreaks. |
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. |
static java.lang.String |
encode(java.lang.String s)
Converts all line breaks within a string (represented by either "\r", "\n" or "\r\n") to canonical ("\r\n") linebreaks. |
static boolean |
isProbablyEncoded(byte[] b)
Tests whether or not all line breaks within a byte array are of the form "\r\n". |
static boolean |
isProbablyEncoded(java.lang.String s)
Test whether or not all line breaks within a String are of the form "\r\n". |
Methods inherited from class java.lang.Object |
|
Method Detail |
public static java.lang.String encode(java.lang.String s)
s
- text to be convertedpublic static byte[] encode(byte[] b)
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.
b
- text to be convertedpublic static java.lang.String decode(java.lang.String s)
s
- text (with canonical line breaks) to be decodedpublic static byte[] decode(byte[] b)
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.
b
- text (with canonical line breaks) to be decodedpublic static boolean isProbablyEncoded(java.lang.String s)
s
- String to be tested.public static boolean isProbablyEncoded(byte[] b)
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.
b
- byte array to be tested.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |