com.sun.cdc.io.j2me.file
Class Protocol

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by com.sun.cdc.io.GeneralBase
                  extended by com.sun.cdc.io.ConnectionBase
                      extended by com.sun.cdc.io.j2me.file.ProtocolBase
                          extended by com.sun.cdc.io.j2me.file.ProtocolNative
                              extended by com.sun.cdc.io.j2me.file.Protocol
All Implemented Interfaces:
ConnectionBaseInterface, DataInput, DataOutput, Connection, InputConnection, OutputConnection, StreamConnection

public class Protocol
extends ProtocolNative

This implements the default "file:" protocol J2SE

This class represents the internal functions that are written in C for KVM in the file storagePrim.c


Field Summary
 
Fields inherited from class com.sun.cdc.io.j2me.file.ProtocolNative
reading, writing
 
Fields inherited from class com.sun.cdc.io.j2me.file.ProtocolBase
O_RAND, O_READ, O_WRITE, openMode, operationMode
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
Protocol()
           
 
Method Summary
 String formName(String name)
           
protected  String getDirectory()
           
 long prim_availableSpace()
           
 boolean prim_canRead()
           
 boolean prim_canWrite()
           
 void prim_clearSelection()
           
 void prim_closeProtocol()
           
 int prim_countItems()
           
 void prim_createAndSelect()
           
 void prim_createDirectoryAndSelect(String name)
           
 void prim_createFileAndSelect(String name)
           
 void prim_createFileAndSelectByInt(int i)
           
 boolean prim_deleteItem()
           
 boolean prim_exists()
           
 void prim_findFirstItemAndSelect()
           
 void prim_findItemAfterSelectionAndSelect()
           
 void prim_findItemAndSelect(String name)
           
 void prim_findItemAndSelectByInt(int i)
           
 long prim_getPosition()
           
 String prim_getSelectionName()
           
 int prim_getSelectionNumber()
           
 boolean prim_isDirectory()
           
 boolean prim_isSelected()
           
 long prim_lengthOf()
           
 Connection prim_openProtocol(String openName, String parms, int mode)
           
 int prim_read()
           
 int prim_readBytes(byte[] b, int off, int len)
           
 void prim_realOpen()
           
 boolean prim_renameDirectory(String name2)
           
 boolean prim_renameFile(String name2)
           
 boolean prim_renameFileByInt(int i)
           
 void prim_seek(long pos)
           
 void prim_setLength(long len)
           
 boolean prim_setReadable(boolean tf)
           
 boolean prim_setWritable(boolean tf)
           
 long prim_timeOf()
           
 void prim_write(int b)
           
 void prim_writeBytes(byte[] b, int off, int len)
           
 
Methods inherited from class com.sun.cdc.io.j2me.file.ProtocolNative
available0, canRead0, canWrite0, clearSelection, close0, create0, createDirectory0, createName0, createNameByInt0, delete0, deselectItem0, getAvailableSpace0, getItemCount0, getItemName0, getItemNumber0, getLength0, getModificationDate0, getPosition0, isDirectory0, isSelected0, open0, read0, readBytes0, rename0, renameByInt0, renameDirectory0, seek0, selectFirstItem0, selectItem0, selectItemByInt0, selectNextItem0, setLength0, setReadable0, setWritable0, write0, writeBytes0
 
Methods inherited from class com.sun.cdc.io.j2me.file.ProtocolBase
canRead, canWrite, checkPermission, close, create, create, create, createDirectory, delete, deleteDirectory, deselectItem, ensureDirectory, ensureNotDirectory, ensureOpen, ensureOpenAndSelected, ensureOpenForReading, ensureOpenForReadingAndSelected, ensureOpenForWriting, ensureOpenForWritingAndSelected, getAvailableSpace, getItemCount, getItemName, getItemNumber, getLength, getModificationDate, getPosition, inputStreamPermissionCheck, isDirectory, isSelected, open, openInputStream, openOutputStream, openPrim, outputStreamPermissionCheck, read, read, read0, rename, rename, renameDirectory, seek, selectFirstItem, selectItem, selectItem, selectNextItem, setLength, setProtocolBaseDirectory, setReadable, setWritable, write, write
 
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
 

Constructor Detail

Protocol

public Protocol()
Method Detail

getDirectory

protected String getDirectory()

formName

public String formName(String name)

prim_openProtocol

public Connection prim_openProtocol(String openName,
                                    String parms,
                                    int mode)
                             throws IOException
Specified by:
prim_openProtocol in class ProtocolNative
Throws:
IOException

prim_closeProtocol

public void prim_closeProtocol()
                        throws IOException
Specified by:
prim_closeProtocol in class ProtocolNative
Throws:
IOException

prim_realOpen

public void prim_realOpen()
                   throws IOException
Specified by:
prim_realOpen in class ProtocolNative
Throws:
IOException

prim_clearSelection

public void prim_clearSelection()
                         throws IOException
Specified by:
prim_clearSelection in class ProtocolNative
Throws:
IOException

prim_isSelected

public boolean prim_isSelected()
Specified by:
prim_isSelected in class ProtocolNative

prim_getSelectionName

public String prim_getSelectionName()
Specified by:
prim_getSelectionName in class ProtocolNative

prim_getSelectionNumber

public int prim_getSelectionNumber()
                            throws IOException
Specified by:
prim_getSelectionNumber in class ProtocolNative
Throws:
IOException

prim_findFirstItemAndSelect

public void prim_findFirstItemAndSelect()
                                 throws IOException
Specified by:
prim_findFirstItemAndSelect in class ProtocolNative
Throws:
IOException

prim_findItemAndSelect

public void prim_findItemAndSelect(String name)
                            throws IOException
Specified by:
prim_findItemAndSelect in class ProtocolNative
Throws:
IOException

prim_findItemAndSelectByInt

public void prim_findItemAndSelectByInt(int i)
                                 throws IOException
Specified by:
prim_findItemAndSelectByInt in class ProtocolNative
Throws:
IOException

prim_findItemAfterSelectionAndSelect

public void prim_findItemAfterSelectionAndSelect()
                                          throws IOException
Specified by:
prim_findItemAfterSelectionAndSelect in class ProtocolNative
Throws:
IOException

prim_createAndSelect

public void prim_createAndSelect()
                          throws IOException
Specified by:
prim_createAndSelect in class ProtocolNative
Throws:
IOException

prim_createFileAndSelect

public void prim_createFileAndSelect(String name)
                              throws IOException
Specified by:
prim_createFileAndSelect in class ProtocolNative
Throws:
IOException

prim_createFileAndSelectByInt

public void prim_createFileAndSelectByInt(int i)
                                   throws IOException
Specified by:
prim_createFileAndSelectByInt in class ProtocolNative
Throws:
IOException

prim_createDirectoryAndSelect

public void prim_createDirectoryAndSelect(String name)
                                   throws IOException
Specified by:
prim_createDirectoryAndSelect in class ProtocolNative
Throws:
IOException

prim_deleteItem

public boolean prim_deleteItem()
Specified by:
prim_deleteItem in class ProtocolNative

prim_renameFile

public boolean prim_renameFile(String name2)
Specified by:
prim_renameFile in class ProtocolNative

prim_renameFileByInt

public boolean prim_renameFileByInt(int i)
Specified by:
prim_renameFileByInt in class ProtocolNative

prim_renameDirectory

public boolean prim_renameDirectory(String name2)
Specified by:
prim_renameDirectory in class ProtocolNative

prim_lengthOf

public long prim_lengthOf()
                   throws IOException
Specified by:
prim_lengthOf in class ProtocolNative
Throws:
IOException

prim_setLength

public void prim_setLength(long len)
                    throws IOException
Specified by:
prim_setLength in class ProtocolNative
Throws:
IOException

prim_timeOf

public long prim_timeOf()
                 throws IOException
Specified by:
prim_timeOf in class ProtocolNative
Throws:
IOException

prim_exists

public boolean prim_exists()
Specified by:
prim_exists in class ProtocolNative

prim_isDirectory

public boolean prim_isDirectory()
Specified by:
prim_isDirectory in class ProtocolNative

prim_canRead

public boolean prim_canRead()
Specified by:
prim_canRead in class ProtocolNative

prim_canWrite

public boolean prim_canWrite()
Specified by:
prim_canWrite in class ProtocolNative

prim_setReadable

public boolean prim_setReadable(boolean tf)
Specified by:
prim_setReadable in class ProtocolNative

prim_setWritable

public boolean prim_setWritable(boolean tf)
Specified by:
prim_setWritable in class ProtocolNative

prim_availableSpace

public long prim_availableSpace()
Specified by:
prim_availableSpace in class ProtocolNative

prim_countItems

public int prim_countItems()
Specified by:
prim_countItems in class ProtocolNative

prim_seek

public void prim_seek(long pos)
               throws IOException
Specified by:
prim_seek in class ProtocolNative
Throws:
IOException

prim_getPosition

public long prim_getPosition()
                      throws IOException
Specified by:
prim_getPosition in class ProtocolNative
Throws:
IOException

prim_read

public int prim_read()
              throws IOException
Specified by:
prim_read in class ProtocolNative
Throws:
IOException

prim_readBytes

public int prim_readBytes(byte[] b,
                          int off,
                          int len)
                   throws IOException
Specified by:
prim_readBytes in class ProtocolNative
Throws:
IOException

prim_write

public void prim_write(int b)
                throws IOException
Specified by:
prim_write in class ProtocolNative
Throws:
IOException

prim_writeBytes

public void prim_writeBytes(byte[] b,
                            int off,
                            int len)
                     throws IOException
Specified by:
prim_writeBytes in class ProtocolNative
Throws:
IOException