|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Output
Interface for a sink for binary output. This is similar to
java.util.DataOutput, but no IOExceptions
are declared, and multibyte output is defined to be little-endian.
| Method Summary | |
|---|---|
void |
alignTo(int alignment)
Adds extra bytes if necessary (with value 0) to
force alignment of the output cursor as given. |
void |
assertCursor(int expectedCursor)
Asserts that the cursor is the given value. |
int |
getCursor()
Gets the current cursor position. |
void |
write(byte[] bytes)
Writes a byte[] to this instance. |
void |
write(byte[] bytes,
int offset,
int length)
Writes a portion of a byte[] to this instance. |
void |
write(ByteArray bytes)
Writes a ByteArray to this instance. |
void |
writeByte(int value)
Writes a byte to this instance. |
void |
writeInt(int value)
Writes an int to this instance. |
void |
writeLong(long value)
Writes a long to this instance. |
void |
writeShort(int value)
Writes a short to this instance. |
int |
writeSleb128(int value)
Writes a DWARFv3-style unsigned LEB128 integer. |
int |
writeUleb128(int value)
Writes a DWARFv3-style unsigned LEB128 integer. |
void |
writeZeroes(int count)
Writes the given number of 0 bytes. |
| Method Detail |
|---|
int getCursor()
>= 0; the cursor positionvoid assertCursor(int expectedCursor)
expectedCursor - the expected cursor value
RuntimeException - thrown if getCursor() !=
expectedCursorvoid writeByte(int value)
byte to this instance.
writeByte in interface ByteOutputvalue - the value to write; all but the low 8 bits are ignoredvoid writeShort(int value)
short to this instance.
value - the value to write; all but the low 16 bits are ignoredvoid writeInt(int value)
int to this instance.
value - the value to writevoid writeLong(long value)
long to this instance.
value - the value to writeint writeUleb128(int value)
value - value to write, treated as an unsigned value
1..5; the number of bytes actually writtenint writeSleb128(int value)
value - value to write
1..5; the number of bytes actually writtenvoid write(ByteArray bytes)
ByteArray to this instance.
bytes - non-null; the array to write
void write(byte[] bytes,
int offset,
int length)
byte[] to this instance.
bytes - non-null; the array to writeoffset - >= 0; offset into bytes for the first
byte to writelength - >= 0; number of bytes to writevoid write(byte[] bytes)
byte[] to this instance. This is just
a convenient shorthand for write(bytes, 0, bytes.length).
bytes - non-null; the array to writevoid writeZeroes(int count)
0 bytes.
count - >= 0; the number of zeroes to writevoid alignTo(int alignment)
0) to
force alignment of the output cursor as given.
alignment - > 0; the alignment; must be a power of two
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||