import static org.tizen.sdblib.SdbHelper.write;\r
import static org.tizen.sdblib.SmartDevelopmentBridgetConstants.ID_DATA;\r
import static org.tizen.sdblib.SmartDevelopmentBridgetConstants.ID_DONE;\r
+import static org.tizen.sdblib.SmartDevelopmentBridgetConstants.ID_QUIT;\r
import static org.tizen.sdblib.SmartDevelopmentBridgetConstants.ID_RECV;\r
import static org.tizen.sdblib.service.FileEntryConstants.REMOTE_PATH_MAX_LENGTH;\r
import static org.tizen.sdblib.service.FileEntryConstants.SYNC_DATA_MAX;\r
import org.tizen.sdblib.SmartDevelopmentBridge;\r
import org.tizen.sdblib.exception.SyncException;\r
import org.tizen.sdblib.exception.TimeoutException;\r
+import org.tizen.sdblib.util.IOUtil;\r
import org.tizen.sdblib.util.Log;\r
\r
/**\r
return 0xFF & data[index++];\r
}\r
\r
+ /**\r
+ * Create a command with a code and an int values\r
+ * @param command\r
+ * @param value\r
+ * @return\r
+ */\r
+ private static\r
+ byte[]\r
+ createReq(\r
+ final byte[] command,\r
+ final int value\r
+ )\r
+ {\r
+ final byte[] array = new byte[8];\r
+\r
+ System.arraycopy(command, 0, array, 0, 4);\r
+ toBytes(value, array, 4);\r
+\r
+ return array;\r
+ }\r
+\r
+\r
+ /* (non-Javadoc)\r
+ * @see java.io.InputStream#close()\r
+ */\r
+ @Override\r
+ public void close() throws IOException\r
+ {\r
+ SdbHelper.write(channel, createReq(ID_QUIT, 0));\r
+ IOUtil.tryClose(channel);\r
+ super.close();\r
+ }\r
+\r
\r
}\r