public class Mime
extends java.lang.Object
Constructor and Description |
---|
Mime() |
Modifier and Type | Method and Description |
---|---|
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.
|
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 arraypublic static final byte[] encode(byte[] x)
x
- input datapublic static final byte[] encode(byte[] x, int width)
x
- input datawidth
- defines after how many input bytes a lf is addedpublic 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 bytespublic 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 arraypublic 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 parameterpublic static byte[] encodeFull(byte[] x, java.lang.String txt) throws java.io.IOException
x
- bytes to encodetxt
- placed behind _----BEGIN and -----ENDjava.io.IOException
- on errorpublic static byte[] createHeader(java.lang.String name)
name
- the name of the original file