|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.elf.ElfInputStream
public class ElfInputStream
This class is similar to the DataInputStream but with optional byte swapping performed. This is useful for "endian" conversion when reading an ELF file.
Copyright (c) 2004 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
| Constructor Summary | |
|---|---|
ElfInputStream(byte[] b,
boolean byteSwap)
This constructor that sets up the ELF Input Stream. |
|
ElfInputStream(byte[] b,
int offset,
boolean byteSwap)
This constructor that sets up the ELF Input Stream. |
|
ElfInputStream(java.io.InputStream in)
The constructor that sets up the ELF Input Stream. |
|
ElfInputStream(java.io.InputStream in,
boolean byteSwap)
This constructor that sets up the ELF Input Stream. |
|
ElfInputStream(java.lang.String filename)
The constructor that sets up the ELF Input Stream. |
|
| Method Summary | |
|---|---|
int |
getOffset()
The method returns the current byte offset into the Elf Input Stream. |
boolean |
isByteSwap()
This method returns the current byte swapping status for this Input Stream. |
int |
read(byte[] b)
This method reads a byte array from the input stream. |
long |
readAddr()
This method reads an address from the input stream. |
byte |
readByte()
This method reads a byte from the input stream. |
int |
readInt()
This method reads an integer from the input stream and does byte swapping if necessary. |
long |
readLong()
This method reads a long integer from the input stream and does byte swapping if necessary. |
short |
readShort()
This method reads a short from the input stream and does byte swapping if necessary. |
java.lang.String |
readString()
This method reads String from the input stream. |
int |
readUnsignedByte()
This method reads an unsigned byte from the input stream. |
int |
readUnsignedShort()
This method reads an unsigned short from the input stream. |
void |
setAddrBytes(int bytes)
This method sets the default address size in bytes. |
void |
setByteSwap(boolean b)
This method sets the byte-swapping flag used by the integer and halfword read methods. |
int |
skipBytes(int i)
This method skips bytes from the input 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 ElfInputStream(java.lang.String filename)
throws java.io.FileNotFoundException
filename - The file name of the ELF Input
Stream.
java.io.FileNotFoundExceptionpublic ElfInputStream(java.io.InputStream in)
in - The Input Stream used by the ELF Input
Stream.
public ElfInputStream(java.io.InputStream in,
boolean byteSwap)
in - The Input Stream used by the ELF Input
Stream.byteSwap - This parameter is set to true if
"endian" byte swapping should be used on this
input stream and false otherwise.
public ElfInputStream(byte[] b,
boolean byteSwap)
b - The byte array used by the ELF Input
Stream.byteSwap - This parameter is set to true if
"endian" byte swapping should be used on this
input stream and false otherwise.
public ElfInputStream(byte[] b,
int offset,
boolean byteSwap)
b - The byte array used by the ELF Input
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 setByteSwap(boolean b)
b - The boolean flag used to enable byte
swapping.public boolean isByteSwap()
public int getOffset()
public void setAddrBytes(int bytes)
public long readLong()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public int readInt()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public short readShort()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public int readUnsignedShort()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public byte readByte()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public int readUnsignedByte()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public int read(byte[] b)
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public long readAddr()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public int skipBytes(int i)
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
public java.lang.String readString()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an error is encountered in
reading the Data Input Stream.
java.io.EOFException - if an end of file is encountered in
reading the Data Input Stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||