Java Reference
In-Depth Information
new FileOutputStream("MyFile");) {
byte b[] = new byte[3072];
int data = input.read(b);
while (data != -1) {
outputStream.write(b);
data = input.read(b);
}
} catch (IOException ex) {
logger.log(Level.SEVERE, null, ex);
}
}
}
To solve this problem, two listeners (
ReadListener
and
WriteListener
) have
been added to the Java EE platform and new APIs were also introduced into
Ser-
vletInputStream
and
ServletOutputStream
.
The following table describes the new listeners for the non blocking I/O API: