|
J2ME Foundation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A connection to a random access memory
Method Summary | |
long |
getLength()
Get the length of the data |
long |
getPosition()
Returns the current offset into the data. |
boolean |
isSelected()
Test to see if a record in the collection is selected. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data into an
array of bytes. |
void |
seek(long pos)
Sets the position pointer offset, measured from the beginning of the data, at which the next read or write occurs. |
void |
setLength(long len)
Set the length of the data (for truncation). |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to the data |
void |
write(int b)
Writes the specified byte to this file. |
Methods inherited from interface javax.microedition.io.InputConnection |
openDataInputStream, openInputStream |
Methods inherited from interface javax.microedition.io.Connection |
close |
Methods inherited from interface javax.microedition.io.OutputConnection |
openDataOutputStream, openOutputStream |
Methods inherited from interface java.io.DataInput |
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes |
Methods inherited from interface java.io.DataOutput |
write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Method Detail |
public boolean isSelected() throws IOException
public void seek(long pos) throws IOException
pos
- the offset position, measured in bytes from the
beginning of the data, at which to set the position
pointer.IOException
- if pos
is less than
0
, if an I/O error occurs, or
there is an input or output stream open on the data.public long getPosition() throws IOException
IOException
- if an I/O error occurs.public long getLength() throws IOException
public void setLength(long len) throws IOException
len
- the new length of the datapublic int read() throws IOException
0x00-0x0ff
). This
method blocks if no input is yet available.
-1
if the end of the
data has been reached.IOException
- if an I/O error occurs. Not thrown if
end-of-data has been reached.public int read(byte[] b, int off, int len) throws IOException
len
bytes of data into an
array of bytes. This method blocks until at least one byte of input
is available.b
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.-1
if there is no more data because the end of
the data has been reached.IOException
- if an I/O error occurs.public void write(int b) throws IOException
write
in interface DataOutput
b
- the byte
to be written.IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws IOException
len
bytes from the specified byte array
starting at offset off
to the datawrite
in interface DataOutput
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.IOException
- if an I/O error occurs.
|
J2ME Foundation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |