|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.ByteArrayOutputStream
|
+--com.sshtools.util.ByteArrayWriter
Provides a reader type interface into the ByteArrayOutputStream
| Field Summary |
| Fields inherited from class java.io.ByteArrayOutputStream |
buf, count |
| Constructor Summary | |
ByteArrayWriter()
Constructor for the ByteArrayWriter object |
|
| Method Summary | |
void |
writeBigInteger(java.math.BigInteger bi)
Writes a BigInteger to the array. |
void |
writeBinaryString(byte[] data)
Writes a binary string to the byte array. |
void |
writeInt(int i)
Writes an integer into the byte array. |
void |
writeInt(long i)
Writes an integer into the byte array. |
static void |
writeIntToArray(byte[] array,
int pos,
int value)
Writes an integer into an array, starting at the position specified |
void |
writeString(java.lang.String str)
Writes a string to the byte array. |
| Methods inherited from class java.io.ByteArrayOutputStream |
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo |
| Methods inherited from class java.io.OutputStream |
flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ByteArrayWriter()
| Method Detail |
public void writeInt(long i)
throws java.io.IOException
Writes an integer into the byte array.
NOTE: This will be replaced with the UnsignedInteger class
i - A long value to write (will be truncated if
greater than max integer size)
java.io.IOException - Thrown if the array cannot be written to
public void writeInt(int i)
throws java.io.IOException
Writes an integer into the byte array.
NOTE: This will be replaced with the UnsignedInteger class
i - The integer value
java.io.IOException - Thrown if the array cannot be written to
public void writeString(java.lang.String str)
throws java.io.IOException
str - The string to write
java.io.IOException - Thrown if the array cannot be written to
public void writeBinaryString(byte[] data)
throws java.io.IOException
data - The data to write
java.io.IOException - Thrown if the array cannot be written to
public void writeBigInteger(java.math.BigInteger bi)
throws java.io.IOException
bi - The BigInteger to write
java.io.IOException - Thrown if the array cannot be written to
public static void writeIntToArray(byte[] array,
int pos,
int value)
throws java.io.IOException
array - The array to write topos - The starting positionvalue - The integer value
java.io.IOException - Thrown if there is not at least 4 bytes of data to
write to from pos to the end of the array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||