lib.dwfl
Class ElfData

java.lang.Object
  extended by lib.dwfl.ElfData

public class ElfData
extends Object

An ElfData is a descriptor of data that will be converted to or from memory format


Field Summary
 byte[] internal_buffer
           
 
Constructor Summary
ElfData(byte[] buffer, Elf parent)
          Package buffer in an ElfData object.
 
Method Summary
 ElfFlags flag(ElfCommand command, ElfFlags flags)
          Flags the data with the provided flag
 long getAlignment()
           
 byte getByte(long offset)
          Returns the byte at the provided offset into the data
 byte[] getBytes()
           
 int getOffset()
           
 Elf getParent()
           
 long getSize()
           
 ElfType getType()
          Returns the Elf Data type
 void setAlignment(long align)
           
 void setBuffer(byte[] e_buffer)
          Sets the buffer to point to the byte[] array This will then be written to disk on elf_update
 void setOffset(int offset)
           
 void setSize(long size)
           
 void setType(int type)
          Sets the Elf Data Type
 ElfData translateToELFRepresentation(int encoding)
          Translates the information into Elf format using the provided encoding
 ElfData translateToMemoryRepresentation(int encoding)
          Translates the information into memory format using the provided encoding
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internal_buffer

public byte[] internal_buffer
Constructor Detail

ElfData

public ElfData(byte[] buffer,
               Elf parent)
Package buffer in an ElfData object.

Method Detail

setBuffer

public void setBuffer(byte[] e_buffer)
Sets the buffer to point to the byte[] array This will then be written to disk on elf_update


getByte

public byte getByte(long offset)
Returns the byte at the provided offset into the data

Parameters:
offset - The offset from which to get the byte
Returns:
The data at offset

getBytes

public byte[] getBytes()

setType

public void setType(int type)
Sets the Elf Data Type

Parameters:
The - type of the data

getType

public ElfType getType()
Returns the Elf Data type

Returns:
The type of the data

getSize

public long getSize()
Returns:
The size of the data in bytes

setSize

public void setSize(long size)
Parameters:
The - size of the data in bytes

getOffset

public int getOffset()
Returns:
The offset into the section of the data

setOffset

public void setOffset(int offset)
Parameters:
The - offset into the section of the data

getAlignment

public long getAlignment()
Returns:
The alignment of the data in the section

setAlignment

public void setAlignment(long align)
Parameters:
The - alignment of the data in the section

translateToMemoryRepresentation

public ElfData translateToMemoryRepresentation(int encoding)
Translates the information into memory format using the provided encoding

Parameters:
encoding - The encoding to use
Returns:
The data in memory format

translateToELFRepresentation

public ElfData translateToELFRepresentation(int encoding)
Translates the information into Elf format using the provided encoding

Parameters:
encoding - The encoding to use
Returns:
The data in Elf format

flag

public ElfFlags flag(ElfCommand command,
                     ElfFlags flags)
Flags the data with the provided flag

Parameters:
command - An ElfCommand
flags - The flags to apply
Returns:
The new flag value

getParent

public Elf getParent()