Package uicc.connection
Interface DataReceived
- All Superinterfaces:
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 TypeMethodDescriptionbooleanThis method indicates if the Content-Type header field conforms to this specification.shortcopyReceivedData(int srcOffset, byte[] dstBuffer, short dstOffset, short dstLength) Copy the received data in a buffer.voidDiscard data that have not been already read.intReturns 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 theObserver.booleanThis 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 theObserver.- 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 thesrcOffsetparameter. This is a non-blocking methid.- Parameters:
srcOffset- the offset of the first byte to copy in the received datadstBuffer- a reference to the destination bufferdstOffset- the position in the destination bufferdstLength- the data length to be copied- Returns:
dstOffset+length of the copied value- Throws:
NullPointerException- ifdstBufferisnullArrayIndexOutOfBoundsException- ifdstOffsetordstLengthor both would cause access outside array bounds, or ifdstLengthis negative.ConnectionException- with the following reason code:OUT_OF_DATA_BOUNDARIESifsrcOffsetordstOffsetordstLengthwould cause access outside received data.INVALID_PARAMETERif the requestedsrcOffsetcould not be reached.
NullPointerException- ifdstBufferis equal tonull
-
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_ALLOWEDif all data have already been received or discarded.
-