Package com.microej.kf.util.control.net
Class ReadSocket
- java.lang.Object
-
- com.microej.kf.util.control.net.AbstractSocket
-
- com.microej.kf.util.control.net.ReadSocket
-
public class ReadSocket extends AbstractSocket
Action performed when reading on a socket.
-
-
Field Summary
-
Fields inherited from class com.microej.kf.util.control.net.AbstractSocket
socket
-
-
Constructor Summary
Constructors Constructor Description ReadSocket(java.net.Socket socket, int nbBytes)Creates a read socket action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetNbBytes()Gets the number of bytes to be read.voidonEnd(int nbBytesRead)Called when the execution of the action is finished.intonStart()Called when the execution of the action is about to start.-
Methods inherited from class com.microej.kf.util.control.net.AbstractSocket
getSocket
-
-
-
-
Method Detail
-
getNbBytes
public int getNbBytes()
Gets the number of bytes to be read.- Returns:
- the number of bytes to be read.
-
onStart
public int onStart() throws java.lang.SecurityExceptionCalled when the execution of the action is about to start. This hook is used to check if the action is allowed to be performed.- Returns:
- the number of bytes read.
- Throws:
java.lang.SecurityException- if the action is not allowed to be performed.
-
onEnd
public void onEnd(int nbBytesRead)
Called when the execution of the action is finished. This hook is used to update the current resources state of the module that performs the action.- Parameters:
nbBytesRead- the actual number of bytes read.
-
-