|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
com.sun.cdc.io.GeneralBase
com.sun.cdc.io.ConnectionBase
com.sun.cdc.io.j2me.file.ProtocolBase
public abstract class ProtocolBase
This implements the default "file:" protocol J2ME
| Field Summary | |
|---|---|
protected static int |
O_RAND
Operation mode |
protected static int |
O_READ
|
protected static int |
O_WRITE
|
protected int |
openMode
Open mode |
protected int |
operationMode
|
| Fields inherited from class java.io.DataOutputStream |
|---|
written |
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
ProtocolBase()
|
|
| Method Summary | |
|---|---|
abstract int |
available0()
|
boolean |
canRead()
Test to see if the selected item can be read |
abstract boolean |
canRead0()
|
boolean |
canWrite()
Test to see if the selected item can be written |
abstract boolean |
canWrite0()
|
protected void |
checkPermission(String name,
String params,
int mode)
|
void |
close()
Close the connection. |
abstract void |
close0()
|
void |
create()
Create a data item in the collection with a randomly chosen unique name and select it |
void |
create(int i)
Create an item with the supplied number |
void |
create(String name)
Create a data item with the supplied name and select it |
abstract void |
create0()
|
void |
createDirectory(String name)
Create a directory with the supplied name |
abstract void |
createDirectory0(String name)
|
abstract void |
createName0(String name)
|
abstract void |
createNameByInt0(int i)
|
void |
delete()
Delete the current data item from the collection |
abstract void |
delete0()
|
void |
deleteDirectory()
Delete the current data item from the collection |
void |
deselectItem()
Unselect the current item. |
abstract void |
deselectItem0()
|
protected void |
ensureDirectory()
|
protected void |
ensureNotDirectory()
|
protected void |
ensureOpen()
|
protected void |
ensureOpenAndSelected()
|
protected void |
ensureOpenForReading()
|
protected void |
ensureOpenForReadingAndSelected()
|
protected void |
ensureOpenForWriting()
|
protected void |
ensureOpenForWritingAndSelected()
|
long |
getAvailableSpace()
Return the size in bytes that the collection can grow to |
abstract long |
getAvailableSpace0()
|
int |
getItemCount()
Return the number of items in the collection |
abstract int |
getItemCount0()
|
String |
getItemName()
Return the name of the currently selected item |
abstract String |
getItemName0()
|
int |
getItemNumber()
Return the number of the current item |
abstract int |
getItemNumber0()
|
long |
getLength()
Get the length of the data |
abstract long |
getLength0()
|
long |
getModificationDate()
Return the date that the item was last modified |
abstract long |
getModificationDate0()
|
long |
getPosition()
Returns the current offset into the data. |
abstract long |
getPosition0()
|
protected void |
inputStreamPermissionCheck()
|
boolean |
isDirectory()
Test to see if the current item a directory |
abstract boolean |
isDirectory0()
|
boolean |
isSelected()
Test to see if a record in the collection is selected. |
abstract boolean |
isSelected0()
|
void |
open(String name,
int mode,
boolean timeouts)
Open a connection to a target. |
abstract Connection |
open0(String openName,
String parms,
int mode)
\ Native Methods * \ |
InputStream |
openInputStream()
Returns an input stream for a database record |
OutputStream |
openOutputStream()
Returns an output stream for this socket. |
Connection |
openPrim(String name,
int mode,
boolean timeouts)
Open a connection to a target. |
protected void |
outputStreamPermissionCheck()
|
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. |
abstract int |
read0()
|
int |
read0(byte[] b,
int off,
int len)
Reads up to len bytes of data into an
array of bytes. |
abstract int |
readBytes0(byte[] b,
int off,
int len)
|
void |
rename(int i)
Rename the current data item |
void |
rename(String newName)
Rename the current data item |
abstract void |
rename0(String name2)
|
abstract void |
renameByInt0(int i)
|
void |
renameDirectory(String newName)
Rename a directory with the supplied name |
abstract void |
renameDirectory0(String name2)
|
void |
seek(long pos)
Sets the position pointer offset, measured from the beginning of the data, at which the next read or write occurs. |
abstract void |
seek0(long pos)
|
boolean |
selectFirstItem()
Select the first record int the database |
abstract boolean |
selectFirstItem0()
|
boolean |
selectItem(int i)
Select an item in the collection |
boolean |
selectItem(String name)
Select an item in the collection |
abstract boolean |
selectItem0(String name)
|
abstract boolean |
selectItemByInt0(int i)
|
boolean |
selectNextItem()
Select the next record int the database |
abstract boolean |
selectNextItem0()
|
void |
setLength(long len)
Set the length of the data (for truncation). |
abstract void |
setLength0(long len)
|
protected void |
setProtocolBaseDirectory(String name)
|
void |
setReadable(boolean tf)
Set or clear the read bit |
abstract void |
setReadable0(boolean tf)
|
void |
setWritable(boolean tf)
Set or clear the write bit |
abstract void |
setWritable0(boolean tf)
|
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. |
abstract void |
write0(int b)
|
abstract void |
writeBytes0(byte[] b,
int off,
int len)
|
| Methods inherited from class com.sun.cdc.io.ConnectionBase |
|---|
openDataInputStream, openDataOutputStream |
| Methods inherited from class com.sun.cdc.io.GeneralBase |
|---|
flush, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skip, skipBytes |
| Methods inherited from class java.io.DataOutputStream |
|---|
size, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Methods inherited from class java.io.FilterOutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.microedition.io.InputConnection |
|---|
openDataInputStream |
| Methods inherited from interface javax.microedition.io.OutputConnection |
|---|
openDataOutputStream |
| Methods inherited from interface java.io.DataOutput |
|---|
write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Field Detail |
|---|
protected int openMode
protected static final int O_RAND
protected static final int O_READ
protected static final int O_WRITE
protected int operationMode
| Constructor Detail |
|---|
public ProtocolBase()
| Method Detail |
|---|
public void open(String name,
int mode,
boolean timeouts)
throws IOException
ConnectionBase
open in class ConnectionBasename - the target of the connectionmode - the access modetimeouts - A flag to indicate that the called wants timeout exceptions
ConnectionNotFoundException - If the connection cannot be found.
IOException - If some other kind of I/O error occurs.
protected void checkPermission(String name,
String params,
int mode)
protected void outputStreamPermissionCheck()
throws IOException
IOExceptionprotected void inputStreamPermissionCheck()
public Connection openPrim(String name,
int mode,
boolean timeouts)
throws IOException
ConnectionBase
openPrim in interface ConnectionBaseInterfaceopenPrim in class ConnectionBasename - the target of the connectionmode - the access modetimeouts - A flag to indicate that the called wants timeout exceptions
ConnectionNotFoundException - If the connection cannot be found.
IOException - If some other kind of I/O error occurs.
protected void ensureOpen()
throws IOException
IOException
protected void ensureOpenForReading()
throws IOException
IOException
protected void ensureOpenForWriting()
throws IOException
IOException
protected void ensureOpenAndSelected()
throws IOException
IOException
protected void ensureOpenForReadingAndSelected()
throws IOException
IOException
protected void ensureOpenForWritingAndSelected()
throws IOException
IOException
protected void ensureDirectory()
throws IOException
IOException
protected void ensureNotDirectory()
throws IOException
IOException
public void close()
throws IOException
close in interface Connectionclose in class GeneralBaseIOException - if an I/O error occurs when closing the
connection.FilterOutputStream.flush(),
FilterOutputStream.outprotected void setProtocolBaseDirectory(String name)
public InputStream openInputStream()
throws IOException
openInputStream in interface InputConnectionopenInputStream in class ConnectionBaseIOException - if an I/O error occurs when creating the
input stream.
public OutputStream openOutputStream()
throws IOException
openOutputStream in interface OutputConnectionopenOutputStream in class ConnectionBaseTrue - if appending
IOException - if an I/O error occurs when creating the
output stream.
public boolean isSelected()
throws IOException
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
IOException
public void setLength(long len)
throws IOException
len - the new length of the data
IOException
public int read()
throws IOException
0x00-0x0ff). This
method blocks if no input is yet available.
read in class GeneralBase-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 int read0(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 DataOutputwrite in class GeneralBaseb - the byte to be written.
IOException - if an I/O error occurs.FilterOutputStream.out
public void write(byte[] b,
int off,
int len)
throws IOException
len bytes from the specified byte array
starting at offset off to the data
write in interface DataOutputwrite in class GeneralBaseb - the data.off - the start offset in the data.len - the number of bytes to write.
IOException - if an I/O error occurs.FilterOutputStream.out
public long getAvailableSpace()
throws IOException
IOException
public int getItemCount()
throws IOException
IOException
public boolean selectFirstItem()
throws IOException
IOException - if an I/O error occurs.
public boolean selectNextItem()
throws IOException
IOException - if an I/O error occurs.
public boolean selectItem(String name)
throws IOException
name - the name of the item to select
IOException - if an I/O error occurs.
public boolean selectItem(int i)
throws IOException
i - the record number
IOException - if an I/O error occurs.
public void deselectItem()
throws IOException
IOException - if an I/O error occurs.
public boolean isDirectory()
throws IOException
IOException
public void create()
throws IOException
IOException - if an I/O error occurs.
public void create(String name)
throws IOException
name - the name of the item to create
IOException - if an I/O error occurs.
public void create(int i)
throws IOException
i - the record number
IOException - if an I/O error occurs.
public void createDirectory(String name)
throws IOException
name - the name of the directory to create
IOException - if an I/O error occurs.
public void delete()
throws IOException
IOException - if an I/O error occurs.
public void deleteDirectory()
throws IOException
IOException - if an I/O error occurs.
public void rename(String newName)
throws IOException
name - the new name for the item
IOException - if an I/O error occurs.
public void rename(int i)
throws IOException
name - the new name for the item
IOException - if an I/O error occurs.
public void renameDirectory(String newName)
throws IOException
newName - the new name for the directory
IOException - if an I/O error occurs.
public String getItemName()
throws IOException
IOException - if an I/O error occurs.
public int getItemNumber()
throws IOException
IOException - if an I/O error occurs or if the item does not have a numeric name.
public long getModificationDate()
throws IOException
IOException - if an I/O error occurs.
public boolean canRead()
throws IOException
IOException - if an I/O error occurs.
public void setReadable(boolean tf)
throws IOException
tf - the new value for the read bit
IOException - if an I/O error occurs.
public boolean canWrite()
throws IOException
IOException - if an I/O error occurs.
public void setWritable(boolean tf)
throws IOException
tf - the new value for the write bit
IOException - if an I/O error occurs.
public abstract Connection open0(String openName,
String parms,
int mode)
throws IOException
IOException
public abstract void close0()
throws IOException
IOException
public abstract long getAvailableSpace0()
throws IOException
IOException
public abstract int getItemCount0()
throws IOException
IOException
public abstract boolean selectFirstItem0()
throws IOException
IOException
public abstract boolean selectNextItem0()
throws IOException
IOException
public abstract boolean selectItem0(String name)
throws IOException
IOException
public abstract boolean selectItemByInt0(int i)
throws IOException
IOException
public abstract void deselectItem0()
throws IOException
IOException
public abstract boolean isSelected0()
throws IOException
IOException
public abstract void create0()
throws IOException
IOException
public abstract void createName0(String name)
throws IOException
IOException
public abstract void createNameByInt0(int i)
throws IOException
IOException
public abstract void createDirectory0(String name)
throws IOException
IOException
public abstract void delete0()
throws IOException
IOException
public abstract void rename0(String name2)
throws IOException
IOException
public abstract void renameByInt0(int i)
throws IOException
IOException
public abstract void renameDirectory0(String name2)
throws IOException
IOException
public abstract long getLength0()
throws IOException
IOException
public abstract void setLength0(long len)
throws IOException
IOException
public abstract long getModificationDate0()
throws IOException
IOException
public abstract String getItemName0()
throws IOException
IOException
public abstract int getItemNumber0()
throws IOException
IOException
public abstract boolean isDirectory0()
throws IOException
IOException
public abstract boolean canRead0()
throws IOException
IOException
public abstract boolean canWrite0()
throws IOException
IOException
public abstract void setReadable0(boolean tf)
throws IOException
IOException
public abstract void setWritable0(boolean tf)
throws IOException
IOException
public abstract int available0()
throws IOException
IOException
public abstract void seek0(long pos)
throws IOException
IOException
public abstract long getPosition0()
throws IOException
IOException
public abstract int read0()
throws IOException
IOException
public abstract int readBytes0(byte[] b,
int off,
int len)
throws IOException
IOException
public abstract void write0(int b)
throws IOException
IOException
public abstract void writeBytes0(byte[] b,
int off,
int len)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||