|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.elf.ElfOutputStream
public class ElfOutputStream
This class is similar to the DataOutputStream but with optional byte swapping performed. This is useful for "endian" conversion when writing an ELF file.
Copyright (c) 2007 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
| Constructor Summary | |
|---|---|
ElfOutputStream(java.io.OutputStream out)
The constructor that sets up the ELF Output Stream. |
|
ElfOutputStream(java.io.OutputStream out,
boolean byteSwap)
This constructor that sets up the ELF Output Stream. |
|
ElfOutputStream(java.lang.String filename)
The constructor that sets up the ELF Output Stream. |
|
| Method Summary | |
|---|---|
void |
close()
This method closes the ELF Output Stream. |
int |
getOffset()
The method returns the current byte offset into the Elf Output Stream. |
boolean |
isByteSwap()
This method returns the current byte swapping status for this Output Stream. |
void |
set32bit()
This method sets the default address size to 32 bits. |
void |
set64bit()
This method sets the default address size to 64 bits. |
void |
setByteSwap(boolean b)
This method sets the byte-swapping flag used by the integer and halfword read methods. |
void |
write(byte[] b)
This method writes a byte array to the output stream. |
void |
writeAddr(long a)
This method writes an address to the output stream. |
void |
writeByte(byte b)
This method writes a byte to the output stream. |
void |
writeInt(int a)
This method writes an integer to the output stream and does byte swapping if necessary. |
void |
writeLong(long a)
This method writes a long integer to the output stream and does byte swapping if necessary. |
void |
writeShort(short a)
This method writes a short to the output stream and does byte swapping if necessary. |
void |
writeString(java.lang.String s)
This method writes a String to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String copyright
| Constructor Detail |
|---|
public ElfOutputStream(java.lang.String filename)
throws java.io.FileNotFoundException
filename - The file name of the new ELF Output
Stream.
java.io.FileNotFoundExceptionpublic ElfOutputStream(java.io.OutputStream out)
out - The Output Stream used by the ELF Input
Stream.
public ElfOutputStream(java.io.OutputStream out,
boolean byteSwap)
out - The Output Stream used by the ELF Output
Stream.byteSwap - This parameter is set to true if
"endian" byte swapping should be used on this
input stream and false otherwise.| Method Detail |
|---|
public void close()
throws java.io.IOException
java.io.IOException - if there is an error closing the
ELF Outptut Stream.public void setByteSwap(boolean b)
b - The boolean flag used to enable byte
swapping.public boolean isByteSwap()
public int getOffset()
public void set32bit()
public void set64bit()
public void writeLong(long a)
throws java.io.IOException
a - the long value to be written.
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
public void writeInt(int a)
throws java.io.IOException
a - the integer to be written.
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
public void writeShort(short a)
throws java.io.IOException
a - the short value to be written.
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
public void writeByte(byte b)
throws java.io.IOException
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
public void write(byte[] b)
throws java.io.IOException
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
public void writeString(java.lang.String s)
throws java.io.IOException
s - the string to be written.
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
public void writeAddr(long a)
throws java.io.IOException
a - The address to be written to the
output stream.
java.io.IOException - if an error is encountered in
writing the Data Output Stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||