|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.archive.wayback.util.ByteOp
public class ByteOp
Byte oriented static methods. Likely a lot of overlap with apache- commons stuff - eventually should be reconciled.
| Field Summary | |
|---|---|
static int |
BUFFER_SIZE
Default buffer size for IO ops |
| Constructor Summary | |
|---|---|
ByteOp()
|
|
| Method Summary | |
|---|---|
static boolean |
cmp(byte[] a,
byte[] b)
Compare two byte arrays |
static byte[] |
copy(byte[] src,
int offset,
int length)
Create a new byte array with contents initialized to values from the argument byte array. |
static void |
copyStream(InputStream is,
OutputStream os)
Write all bytes from is to os. |
static void |
copyStream(InputStream is,
OutputStream os,
int size)
Write all bytes from is to os. |
static void |
discardStream(InputStream is)
throw away all bytes from stream argument |
static void |
discardStream(InputStream is,
int size)
throw away all bytes from stream argument |
static long |
discardStreamCount(InputStream is)
throw away all bytes from stream argument, and count how many bytes were discarded before reaching the end of the stream. |
static long |
discardStreamCount(InputStream is,
int size)
throw away all bytes from stream argument, and count how many bytes were discarded before reaching the end of the stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BUFFER_SIZE
| Constructor Detail |
|---|
public ByteOp()
| Method Detail |
|---|
public static byte[] copy(byte[] src,
int offset,
int length)
src - source byte array of initial valuesoffset - start offset to copy byteslength - number of bytes to copy
public static boolean cmp(byte[] a,
byte[] b)
a - byte array to compareb - byte array to compare
public static void discardStream(InputStream is)
throws IOException
is - InputStream to read and discard
IOException - when is throws one
public static void discardStream(InputStream is,
int size)
throws IOException
is - InputStream to read and discardsize - number of bytes to read at once from the stream
IOException - when is throws one
public static long discardStreamCount(InputStream is)
throws IOException
is - InputStream to read and discard
IOException - when is throws one
public static long discardStreamCount(InputStream is,
int size)
throws IOException
is - InputStream to read and discardsize - number of bytes to read at once from the stream
IOException - when is throws one
public static void copyStream(InputStream is,
OutputStream os)
throws IOException
is - to copy bytes fromos - to copy bytes to
IOException - for usual reasons
public static void copyStream(InputStream is,
OutputStream os,
int size)
throws IOException
is - to copy bytes fromos - to copy bytes tosize - number of bytes to buffer between read and write operations
IOException - for usual reasons
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||