|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.bb.util.Mime
public class Mime
Some helpfull static functions to handle Mime encoding and decoding.
| Constructor Summary | |
|---|---|
Mime()
|
|
| Method Summary | |
|---|---|
static byte[] |
createHeader(java.lang.String name)
Create a Mime header for base64 encoded data. |
static byte[] |
decode(byte[] x,
int i,
int stop)
Do base64 decode of a byte array. |
static byte[] |
encode(byte[] x)
Do base64 encode of a byte array. |
static byte[] |
encode(byte[] x,
int width)
Do base64 encode of a byte array. |
static byte[] |
encodeFull(byte[] x,
java.lang.String txt)
Encode with header / footer. |
static java.lang.String |
getParam(byte[] b,
int off,
java.lang.String param)
Search a base64 parameter. |
static byte[] |
searchDecode(byte[] x)
Search an base64 encodede range. |
static byte[] |
searchDecode(byte[] x,
int off)
Search an base64 encodede range. |
static int |
strstr(byte[] s,
int off,
byte[] x)
Search a byte array within another byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Mime()
| Method Detail |
|---|
public static final byte[] decode(byte[] x,
int i,
int stop)
x - input datai - an int specifying the start index into byte arraystop - an int specifying the stop index into byte array
public static final byte[] encode(byte[] x)
x - input data
public static final byte[] encode(byte[] x,
int width)
x - input datawidth - defines after how many input bytes a lf is added
public static int strstr(byte[] s,
int off,
byte[] x)
s - the searched byte arrayoff - an offset where the search startsx - we are looking for these bytes
public static byte[] searchDecode(byte[] x)
x - the bytes to be searched for "-----BEGIN ..." ... "-----END ..."
public static byte[] searchDecode(byte[] x,
int off)
x - the bytes to be searched for "-----BEGIN ..." ... "-----END ..."off - an offset into the byte array
public static java.lang.String getParam(byte[] b,
int off,
java.lang.String param)
b - the searched bytesoff - offset to start the searchparam - name of wanted parameter
public static byte[] encodeFull(byte[] x,
java.lang.String txt)
throws java.io.IOException
x - bytes to encodetxt - placed behind _----BEGIN and -----END
java.io.IOException - on errorpublic static byte[] createHeader(java.lang.String name)
name - the name of the original file
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||