android.content
public
final
class
android.content.AssetManager.AssetInputStream
Summary
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
final
int
available()
Answers a int representing then number of bytes that are available before
this InputStream will block. This method always returns 0. Subclasses
should override and indicate the correct number of bytes available.
public
final
void
close()
Close the InputStream. Concrete implementations of this class should free
any resources during close. This implementation does nothing.
public
final
int
getAssetInt()
public
final
void
mark(int readlimit)
Set a Mark position in this InputStream. The parameter
readLimit indicates how many bytes can be read before a
mark is invalidated. Sending reset() will reposition the Stream back to
the marked position provided
readLimit has not been
surpassed.
This default implementation does nothing and concrete subclasses must
provide their own implementations.
Parameters
| readlimit
| the number of bytes to be able to read before invalidating the
mark.
|
public
final
boolean
markSupported()
Answers a boolean indicating whether or not this InputStream supports
mark() and reset(). This class provides a default implementation which
answers false.
public
final
int
read(byte[] b, int off, int len)
Reads at most
length bytes from the Stream and stores them
in byte array
b starting at
offset. Answer
the number of bytes actually read or -1 if no bytes were read and end of
stream was encountered.
Parameters
| b
| the byte array in which to store the read bytes. |
| off
| the offset in b to store the read bytes. |
| len
| the maximum number of bytes to store in b. |
public
final
int
read(byte[] b)
Reads bytes from the Stream and stores them in byte array
b.
Answer the number of bytes actually read or -1 if no bytes were read and
end of stream was encountered.
Parameters
| b
| the byte array in which to store the read bytes. |
public
final
int
read()
Reads a single byte from this InputStream and returns the result as an
int. The low-order byte is returned or -1 of the end of stream was
encountered. This abstract implementation must be provided by concrete
subclasses.
public
final
void
reset()
Reset this InputStream to the last marked location. If the
readlimit has been passed or no
mark has
been set, throw IOException. This implementation throws IOException and
concrete subclasses should provide proper implementations.
public
final
long
skip(long n)
Skips
n number of bytes in this InputStream. Subsequent
read()'s will not return these bytes unless
reset() is used. This method may perform multiple reads to
read
n bytes. This default implementation reads
n bytes into a temporary buffer. Concrete subclasses
should provide their own implementation.
Parameters
| n
| the number of bytes to skip. |
Protected Methods
protected
void
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver. Subclasses can use this facility to guarantee
that any associated resources are cleaned up before the receiver is
garbage collected. Uncaught exceptions which are thrown during the
running of the method cause it to terminate immediately, but are
otherwise ignored.
Note: The virtual machine assumes that the implementation in class Object
is empty.