Class DataSocket
java.lang.Object
ecmwf.common.ftp.DataSocket
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionDataSocket(Socket socket, boolean dataAlive) Instantiates a new data socket. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this stream and performs all associated cleanup.voidclose(boolean force) Close.Gets the input stream.getOutputStream(long size) Gets the output stream.booleanisOpen()Checks if is open.toString()To string.
-
Constructor Details
-
DataSocket
Instantiates a new data socket.- Parameters:
socket- the socketdataAlive- the data alive
-
-
Method Details
-
getInputStream
Gets the input stream.- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getOutputStream
Gets the output stream.- Parameters:
size- the size- Returns:
- the output stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
close
Closes this stream and performs all associated cleanup.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- If an error occurs during closing.
-
close
Close.- Parameters:
force- the force- Throws:
IOException- Signals that an I/O exception has occurred.
-
isOpen
public boolean isOpen()Checks if is open.- Returns:
- true, if is open
-
toString
-