Interface DataReceived

All Superinterfaces:
Event

public interface DataReceived extends Event
This event notifies a UICCTransportLink, BIPLink or SCP81Connection about data reception. The object implementing DataReceived interface is a Temporary Entry Point Object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This method indicates if the Content-Type header field conforms to this specification.
    short
    copyReceivedData(int srcOffset, byte[] dstBuffer, short dstOffset, short dstLength)
    Copy the received data in a buffer.
    void
    Discard data that have not been already read.
    int
    Returns the amount of data received, or -1 if data length is unknown (chunked transfer encoding is used), or 0 if all received data have been read or discarded by the Observer.
    boolean
    This method provides information if the transfer of the HTTP POST response was completely received.

    Methods inherited from interface uicc.connection.Event

    getObservable
  • Method Details

    • getReceivedDataLength

      int getReceivedDataLength()
      Returns the amount of data received, or -1 if data length is unknown (chunked transfer encoding is used), or 0 if all received data have been read or discarded by the Observer.
      Returns:
      data length received or 0 if all data have been received or -1 if data length is unknown
    • copyReceivedData

      short copyReceivedData(int srcOffset, byte[] dstBuffer, short dstOffset, short dstLength)
      Copy the received data in a buffer. Data are handled as a stream, and are received upon applet request. It is not possible to move backward in the data by using the srcOffset parameter. This is a non-blocking methid.
      Parameters:
      srcOffset - the offset of the first byte to copy in the received data
      dstBuffer - a reference to the destination buffer
      dstOffset - the position in the destination buffer
      dstLength - the data length to be copied
      Returns:
      dstOffset+length of the copied value
      Throws:
      NullPointerException - if dstBuffer is null
      ArrayIndexOutOfBoundsException - if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative.
      ConnectionException - with the following reason code:
      • OUT_OF_DATA_BOUNDARIES if srcOffset or dstOffset or dstLength would cause access outside received data.
      • INVALID_PARAMETER if the requested srcOffset could not be reached.
      NullPointerException - if dstBuffer is equal to null
    • responseIsComplete

      boolean responseIsComplete()
      This method provides information if the transfer of the HTTP POST response was completely received.
      Returns:
      true if this fragment is the last or only fragment of the response data, false if the transfer is not yet complete (e.g. more data is expected in transfer coding chunked).
    • contentTypeIsCorrect

      boolean contentTypeIsCorrect()
      This method indicates if the Content-Type header field conforms to this specification. The message body can be read even if this method indicates a wrong Content-Type header field.
      Returns:
      true if Content-Type conforms to this specification, false otherwise.
    • discardRemainingData

      void discardRemainingData()
      Discard data that have not been already read. Once invoked, no data could be read anymore.
      This method is blocking until all data have been received by the underlying connection.
      Throws:
      ConnectionException - with the following reason code:
      • OPERATION_NOT_ALLOWED if all data have already been received or discarded.