This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cyberterror; | |
import java.io.*; | |
public class Main { | |
public static void main(String[] args) { | |
/** Формат ввода : | |
* [файл для чтения] [файл для записи] [номер столбца] */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level18.lesson10.bonus02; | |
/* Прайсы | |
CrUD для таблицы внутри файла | |
Считать с консоли имя файла для операций CrUD | |
Программа запускается со следующим набором параметров: | |
-c productName price quantity | |
Значения параметров: | |
где id - 8 символов | |
productName - название товара, 30 chars (60 bytes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level18.lesson10.bonus01; | |
/* Шифровка | |
Придумать механизм шифровки/дешифровки | |
Программа запускается с одним из следующих наборов параметров: | |
-e fileName fileOutputName | |
-d fileName fileOutputName | |
где | |
fileName - имя файла, который необходимо зашифровать/расшифровать |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level18.lesson10.home10; | |
/* Собираем файл | |
Собираем файл из кусочков | |
Считывать с консоли имена файлов | |
Каждый файл имеет имя: [someName].partN. Например, Lion.avi.part1, Lion.avi.part2, ..., Lion.avi.part37. | |
Имена файлов подаются в произвольном порядке. Ввод заканчивается словом "end" | |
В папке, где находятся все прочтенные файлы, создать файл без приставки [.partN]. Например, Lion.avi | |
В него переписать все байты из файлов-частей используя буфер. | |
Файлы переписывать в строгой последовательности, сначала первую часть, потом вторую, ..., в конце - последнюю. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Handler implements Runnable{ | |
/** Count of objects is used in session Name*/ | |
private static int count; | |
private int sessionCount; | |
/** Two variables used in communication process*/ | |
private final SelectionKey handlerKey; | |
private final SocketChannel socketChannel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Acceptor implements Runnable{ | |
private SelectionKey selectionKey; | |
private ServerSocketChannel serverSocketChannel; | |
private final Boolean isWithThreadPool; | |
private final String sessionName = "Acceptor"; | |
private String sessionAdress; | |
public Acceptor(final SelectionKey selectionKey, Boolean isWithThreadPool) throws IOException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CommandCenterNio extends Task<Void>{ | |
final Selector selector; | |
final ServerSocketChannel serverSocketChannel; | |
final boolean isWithThreadPool; | |
private InetSocketAddress address; | |
private Main main; |