PhotoCardImpl



com.licel.jcardsim.samples.photocard
Class PhotoCardImpl

java.lang.Object
  extended by javacard.framework.service.CardRemoteObject
      extended by com.licel.jcardsim.samples.photocard.PhotoCardImpl
All Implemented Interfaces:
PhotoCard, Remote

public class PhotoCardImpl
extends CardRemoteObject
implements PhotoCard


Field Summary
 
Fields inherited from interface com.licel.jcardsim.samples.photocard.PhotoCard
INVALID_ARGUMENT, INVALID_PHOTO_ID, MAX_BUFFER_BYTES, MAX_PHOTO_COUNT, MAX_SIZE, NO_PHOTO_STORED, NO_SPACE_AVAILABLE
 
Method Summary
 void deletePhoto(short photoID)
          This method deletes the photo whose ID is specified in the card.
 byte[] getPhoto(short photoID, short offset, short size)
          This method retrueves a series of bytes belonging to the photo from the smart card at the position specified.
 short getPhotoSize(short photoID)
          This method retrieves the photo size whose ID is specified.
 void loadPhoto(short photoID, byte[] data, short size, short offset, boolean more)
          This method loads a series of bytes belonging to the photo into the smart card at the position specified.
 short requestPhotoStorage(short size)
          This method requests the smart card to allocate space to store a photo image of the specified size.
 
Methods inherited from class javacard.framework.service.CardRemoteObject
export, unexport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

requestPhotoStorage

public short requestPhotoStorage(short size)
                          throws RemoteException,
                                 UserException
Description copied from interface: PhotoCard
This method requests the smart card to allocate space to store a photo image of the specified size.

Specified by:
requestPhotoStorage in interface PhotoCard
Parameters:
size - - Image size to store in the smart card
Returns:
photoID - ID slot in card where photo will be stored
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

loadPhoto

public void loadPhoto(short photoID,
                      byte[] data,
                      short size,
                      short offset,
                      boolean more)
               throws RemoteException,
                      UserException
Description copied from interface: PhotoCard
This method loads a series of bytes belonging to the photo into the smart card at the position specified.

Specified by:
loadPhoto in interface PhotoCard
Parameters:
photoID - - photo slot where to store data
data - - byte array contaiing binary photo information
size - - number of bytes being passed into the smart card
offset - - position inside photo buffer where to store data.
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

deletePhoto

public void deletePhoto(short photoID)
                 throws RemoteException,
                        UserException
Description copied from interface: PhotoCard
This method deletes the photo whose ID is specified in the card.

Specified by:
deletePhoto in interface PhotoCard
Parameters:
photoID - - ID slot of photo to delete
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

getPhotoSize

public short getPhotoSize(short photoID)
                   throws RemoteException,
                          UserException
Description copied from interface: PhotoCard
This method retrieves the photo size whose ID is specified.

Specified by:
getPhotoSize in interface PhotoCard
Parameters:
photoID - - ID slot of photo to access
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

getPhoto

public byte[] getPhoto(short photoID,
                       short offset,
                       short size)
                throws RemoteException,
                       UserException
Description copied from interface: PhotoCard
This method retrueves a series of bytes belonging to the photo from the smart card at the position specified.

Specified by:
getPhoto in interface PhotoCard
Parameters:
photoID - - photo slot where to store data
offset - - position inside photo buffer where to access data.
size - - number of bytes expected from the smart card
Returns:
byte array with binary data from photo stored inside the smart card
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException