|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.freecompany.redline.Util
public class Util
General utilities needed to read and write RPM files. Some of these utilities are available elsewhere but reproduced here to minimize runtime dependencies.
| Method Summary | |
|---|---|
static void |
check(byte expected,
byte actual)
Checks that two bytes are the same, while generating a formatted error message if they are not. |
static void |
check(int expected,
int actual)
Checks that two integers are the same, while generating a formatted error message if they are not. |
static int |
difference(int start,
int boundary)
|
static void |
dump(byte[] data)
|
static void |
dump(byte[] data,
java.lang.Appendable out)
|
static void |
dump(java.nio.ByteBuffer buf,
java.lang.Appendable out)
|
static void |
dump(char[] data)
|
static void |
dump(char[] data,
java.lang.Appendable out)
|
static void |
dump(java.lang.CharSequence data)
|
static void |
empty(java.nio.channels.WritableByteChannel out,
java.nio.ByteBuffer buffer)
Empties the contents of the given buffer into the writable channel provided. |
static java.nio.ByteBuffer |
fill(java.nio.channels.ReadableByteChannel in,
java.nio.ByteBuffer buffer)
Fills the provided buffer it with bytes from the provided channel. |
static java.nio.ByteBuffer |
fill(java.nio.channels.ReadableByteChannel in,
int size)
Creates a new buffer and fills it with bytes from the provided channel. |
static java.lang.String |
hex(byte[] data)
|
static java.lang.String |
normalizePath(java.lang.String path)
Converts path characters from their native format to the "forward-slash" format expected within RPM files. |
static void |
pad(java.nio.ByteBuffer buffer,
int boundary)
Pads the given buffer up to the indicated boundary. |
static int |
round(int start,
int boundary)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String normalizePath(java.lang.String path)
public static java.nio.ByteBuffer fill(java.nio.channels.ReadableByteChannel in,
int size)
throws java.io.IOException
in - the channel to read fromsize - the number of bytes to read into a new buffer
java.io.IOException - if an IO error occurs
public static java.nio.ByteBuffer fill(java.nio.channels.ReadableByteChannel in,
java.nio.ByteBuffer buffer)
throws java.io.IOException
in - the channel to read frombuffer - the buffer to read into
java.io.IOException - if an IO error occurs
public static void empty(java.nio.channels.WritableByteChannel out,
java.nio.ByteBuffer buffer)
throws java.io.IOException
out - the channel to write tobuffer - the buffer to write out to the channel
java.io.IOException - if an IO error occurs
public static void check(int expected,
int actual)
throws java.io.IOException
expected - the expected valueactual - the actual value
java.io.IOException - if the two values do not match
public static void check(byte expected,
byte actual)
throws java.io.IOException
expected - the expected valueactual - the actual value
java.io.IOException - if the two values do not match
public static int difference(int start,
int boundary)
public static int round(int start,
int boundary)
public static void pad(java.nio.ByteBuffer buffer,
int boundary)
buffer - the buffer to pad zeros intoboundary - the boundary to which we need to padpublic static void dump(byte[] data)
public static void dump(byte[] data,
java.lang.Appendable out)
public static void dump(char[] data)
public static void dump(java.lang.CharSequence data)
public static void dump(char[] data,
java.lang.Appendable out)
public static void dump(java.nio.ByteBuffer buf,
java.lang.Appendable out)
public static java.lang.String hex(byte[] data)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||