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
           
private  Elf parent
           
private  long pointer
           
 
Constructor Summary
  ElfData(byte[] buffer, Elf parent)
          Package buffer in an ElfData object.
protected ElfData(long ptr, Elf parent)
           
 
Method Summary
private  void elf_data_create_native()
           
private  void elf_data_finalize()
           
protected  long elf_data_get_align()
           
protected  byte elf_data_get_byte(long offset)
           
protected  int elf_data_get_off()
           
protected  long elf_data_get_size()
           
protected  int elf_data_get_type()
           
protected  int elf_data_get_version()
           
protected  void elf_data_set_align(long align)
           
protected  void elf_data_set_buff(long length)
           
protected  void elf_data_set_off(int offset)
           
protected  void elf_data_set_size(long size)
           
protected  void elf_data_set_type(int type)
           
protected  void elf_data_set_version(int version)
           
protected  int elf_flagdata(int __cmd, int __flags)
           
protected  long elf_xlatetof(int __encode)
           
protected  long elf_xlatetom(int __encode)
           
protected  void finalize()
           
 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()
           
protected  long getPointer()
           
 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
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pointer

private long pointer

parent

private Elf parent

internal_buffer

public byte[] internal_buffer
Constructor Detail

ElfData

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


ElfData

protected ElfData(long ptr,
                  Elf parent)
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

getPointer

protected long getPointer()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getParent

public Elf getParent()

elf_data_create_native

private void elf_data_create_native()

elf_data_finalize

private void elf_data_finalize()

elf_data_set_buff

protected void elf_data_set_buff(long length)

elf_data_get_byte

protected byte elf_data_get_byte(long offset)

elf_data_get_type

protected int elf_data_get_type()

elf_data_set_type

protected void elf_data_set_type(int type)

elf_data_get_version

protected int elf_data_get_version()

elf_data_set_version

protected void elf_data_set_version(int version)

elf_data_get_size

protected long elf_data_get_size()

elf_data_set_size

protected void elf_data_set_size(long size)

elf_data_get_off

protected int elf_data_get_off()

elf_data_set_off

protected void elf_data_set_off(int offset)

elf_data_get_align

protected long elf_data_get_align()

elf_data_set_align

protected void elf_data_set_align(long align)

elf_flagdata

protected int elf_flagdata(int __cmd,
                           int __flags)

elf_xlatetom

protected long elf_xlatetom(int __encode)

elf_xlatetof

protected long elf_xlatetof(int __encode)