Class TransferReceived
-
- All Implemented Interfaces:
public class TransferReceived
The type Transfer received.
-
-
Field Summary
Fields Modifier and Type Field Description public final Array<byte>
receivedBytes
public final TransferType
transferType
-
Constructor Summary
Constructors Constructor Description TransferReceived(Array<byte> receivedBytes, TransferType transferType)
Instantiates a new Transfer received.
-
Method Summary
Modifier and Type Method Description Array<byte>
getReceivedBytes()
Get received bytes byte [ ]. TransferType
getTransferType()
Gets transfer type. void
runForServer(@NonNull() Consumer<Array<byte>> consumer)
Consume bytes received from server. void
runCatchingForServer(@NonNull() Functions.FailableConsumer<Array<byte>, Exception> consumer)
Consume bytes received from server able to catch any exceptions void
runForDevice(@NonNull() Consumer<Array<byte>> consumer)
Consume bytes received from device. void
runCatchingForDevice(@NonNull() Functions.FailableConsumer<Array<byte>, Exception> consumer)
Consume bytes received from device rethrowing any consumer exceptions String
toString()
-
-
Constructor Detail
-
TransferReceived
TransferReceived(Array<byte> receivedBytes, TransferType transferType)
Instantiates a new Transfer received.- Parameters:
receivedBytes
- the received bytestransferType
- the transfer type
-
-
Method Detail
-
getReceivedBytes
@NonNull() Array<byte> getReceivedBytes()
Get received bytes byte [ ].
-
getTransferType
@NonNull() TransferType getTransferType()
Gets transfer type.
-
runForServer
void runForServer(@NonNull() Consumer<Array<byte>> consumer)
Consume bytes received from server.
- Parameters:
consumer
- the consumer
-
runCatchingForServer
void runCatchingForServer(@NonNull() Functions.FailableConsumer<Array<byte>, Exception> consumer)
Consume bytes received from server able to catch any exceptions
- Parameters:
consumer
- the consumer
-
runForDevice
void runForDevice(@NonNull() Consumer<Array<byte>> consumer)
Consume bytes received from device.
- Parameters:
consumer
- the consumer
-
runCatchingForDevice
void runCatchingForDevice(@NonNull() Functions.FailableConsumer<Array<byte>, Exception> consumer)
Consume bytes received from device rethrowing any consumer exceptions
- Parameters:
consumer
- the consumer
-
-
-
-