PHP's stream API provides features to create custom "streams" within the zend engine. These stream features were designed to look and feel as if they were native Unix-like file descriptors where one can fopen, fwrite, fread, fseek, etc as if a normal file, but with custom handlers that could (for example) open a database connection on fopen, perform a SQL SELECT on fread, an SQL INSERT on fwrite, etc, creating a "high-level" database API which behaves like a normal file.
These stream handlers are best when written in C/C++, and PHP/Zend provide a native API for creating stream handlers.
Does Java VM provide a native API for this type of data handling?