Greetings. I need on the basis of an existing stream of writing to a specific file (FileOutputStream outputStream) - to create a stream of reading from it. I get a file descriptor from outputStream and create a read stream
FileInputStream fileInputStream = new FileInputStream(outputStream.getFD(). At attempt of reading from a file (fileInputStream.read) the exception takes off: '
Exception in thread "main" java.io.IOException: Отказано в доступе at java.io.FileInputStream.read0(Native Method) at java.io.FileInputStream.read(FileInputStream.java:207) When writing to this file via outputStream, there were no problems, only when reading through a descriptor. In addition, the descriptor method fd.valid () returns true. Help me to understand