public final class Util extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BASE_64
The characters for Base64 encoding.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
base64(byte[] buf)
Base-64 encode a byte array, returning the returning string.
|
static void |
close(FileChannel rc) |
static void |
close(RandomAccessFile randAccess) |
static String |
readLine(InputStream in)
Read up to a '\n' or '\r', and return the resulting string.
|
static String |
toHexString(byte[] b)
Convert a byte array to a big-endian ordered hexadecimal string.
|
static String |
toHexString(byte[] b,
int off,
int len)
Convert a byte array to a big-endian ordered hexadecimal string.
|
static void |
writeASCII(OutputStream out,
String ascii)
Write a String as a sequece of ASCII bytes.
|
public static final String BASE_64
public static String base64(byte[] buf)
Note that this method exists merely to be compatible with the challenge-response authentication method of rsyncd. It is not technincally a Base-64 encoder.
buf - The byte array to encode.public static void writeASCII(OutputStream out, String ascii) throws IOException
out - The OutputStream to write to.ascii - The ASCII string to write.IOException - If writing fails.public static String readLine(InputStream in) throws IOException
in - The InputStream to read from.IOExceptionpublic static String toHexString(byte[] b)
b - The bytes to convert.public static String toHexString(byte[] b, int off, int len)
b - The bytes to convert.public static void close(RandomAccessFile randAccess)
public static void close(FileChannel rc)
Copyright © 2021 McEvoy Software Ltd. All rights reserved.