danger.app
Class Resource

java.lang.Object
  |
  +--danger.app.Resource

public class Resource
extends java.lang.Object


Method Summary
 int getByte(int offset)
          Read a single byte from a specified offset into the resource.
 void getBytes(byte[] dest, int offset, int count)
          Copy some number of bytes from a specified offset into the resource into the provided byte array.
 int getID()
          Obtain the ID of this resource
 java.io.InputStream getInputStream()
           
 int getInt(int offset)
          Read a little-endian integer from a specified offset into the resource.
 int getShort(int offset)
          Read a little-endian short from a specified offset into the resource.
 int getSize()
          Obtain the length of the data contained by this resource.
 int getType()
          Obtain the type code of this resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getType

public int getType()
Obtain the type code of this resource

getID

public int getID()
Obtain the ID of this resource

getSize

public int getSize()
Obtain the length of the data contained by this resource.

getByte

public int getByte(int offset)
Read a single byte from a specified offset into the resource.
Throws:
IndexOutOfBoundsException - if the offset is out of range

getShort

public int getShort(int offset)
Read a little-endian short from a specified offset into the resource.
Throws:
IndexOutOfBoundsException - if the offset is out of range

getInt

public int getInt(int offset)
Read a little-endian integer from a specified offset into the resource.
Throws:
IndexOutOfBoundsException - if the offset is out of range

getBytes

public void getBytes(byte[] dest,
                     int offset,
                     int count)
Copy some number of bytes from a specified offset into the resource into the provided byte array.
Throws:
IndexOutOfBoundsException - if the offset is out of range

getInputStream

public java.io.InputStream getInputStream()


Danger Confidential. Copyright © 2000-2003, Danger Inc.