byte[] bytes = new byte[1024];
while (inputStream.read(bytes) != -1) {
zipOutputStream.write(bytes);
}package com.javarush.task.task31.task3110;
import java.io.File;
import java.nio.file.Path;
public class test {
public static void main(String[] args) {
File file = new File("simpleFile.txt");
String fullPath = file.getAbsolutePath();
System.out.println(fullPath);
int startInd = fullPath.lastIndexOf("\\") + 1;
int endInd = fullPath.lastIndexOf(".");
String fileName = fullPath.substring(startInd, endInd);
System.out.println(fileName);
}
}