How can you read a ZIP file with the FileSystem API? - #java #javacoding #javatips #coding

preview_player
Показать описание
Cracking the #Java #Coding #Interview - Question 258: How can you read a ZIP file with the FileSystem API?
#javalanguage #javacoding #javatips #javacodinginterview #coding
Рекомендации по теме
Комментарии
Автор

Way back in the day, I was tasked with writing a Java front end to a C++ program. One of the functions needed to transfer a large array of integers as quickly as possible to the Java side of the program. While I could have done this with Java's JNI functions, I recognized it was going to be a big bottleneck in terms of speed. Then I happened on the NIO library. Lo and behold, there was an NIO function used for a totally different purpose that allowed the Java side of the program to access an integer array created in C++. It was easy and it worked great.

Moral of the story: sometimes you can find what you need in unexpected places. It's worth looking into the major Java libraries to see what they provide, even if you don't see an immediate need for them.

danblanks
Автор

lol, java developers found a new convoluted way to do something that should require one line.

Marque
Автор

Still need to be careful with zip bombs.

RBCu
Автор

So you meant to say what works fine in Windows may mess up in Linux? 😂

VuLinhAssassin
Автор

Since even ZIP made it into Java, I wonder if .toml did too

welcome to shbcf.ru