|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.io.ByteArrayInputConnection
public class ByteArrayInputConnection
A convenience implementation of InputConnection
that takes a byte[]
for its source data.
Field Summary | ||
---|---|---|
protected byte[] |
_data
A reference to the underlying byte data of this input connection. |
Constructor Summary | ||
---|---|---|
ByteArrayInputConnection(byte[] data)
Create a new ByteArrayInputConnection with the given data. |
Method Summary | ||
---|---|---|
void |
close()
This method does nothing. |
|
DataInputStream |
openDataInputStream()
This method creates and returns a new DataInputStream that
allows reading of the underlying byte data. |
|
InputStream |
openInputStream()
This method creates and returns a new InputStream that
allows reading of the underlying byte data. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] _data
Constructor Detail |
---|
public ByteArrayInputConnection(byte[] data)
ByteArrayInputConnection
with the given data.
Note that the byte data is NOT copied; since the caller still has a
reference to the data, it may be mutated while it is being read. If
this is not desired, users of this class should clone the data prior
to creating a ByteArrayInputConnection
.
data
- the byte[] data. This must not be null
.
IllegalArgumentException
- If data
is null
.Method Detail |
---|
public InputStream openInputStream() throws IOException
InputStream
that
allows reading of the underlying byte data. This method may be called
multiple times; each invocation will return a new InputStream
object.
openInputStream
in interface InputConnection
InputStream
that allows reading of the byte data.
IOException
- This exception is not thrown this class; however, the
throws
clause is included in the method signature to allow
subclasses to throw the exception if they need to do so.public DataInputStream openDataInputStream() throws IOException
DataInputStream
that
allows reading of the underlying byte data. This method may be called
multiple times; each invocation will return a new DataInputStream
object.
openDataInputStream
in interface InputConnection
DataInputStream
that allows reading of the byte data.
IOException
- This exception is not thrown this class; however, the
throws
clause is included in the method signature to allow
subclasses to throw the exception if they need to do so.public void close() throws IOException
close
in interface Connection
IOException
- This exception is not thrown this class; however, the
throws
clause is included in the method signature to allow
subclasses to throw the exception if they need to do so.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal