File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes A question about ByteBuffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "A question about ByteBuffer" Watch "A question about ByteBuffer" New topic

A question about ByteBuffer

Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
This is from the ByteBuffer doc of j2sdk:
An implementation of the Java platform may optionally support the creation of direct byte buffers from native code via JNI. If an instance of one of these kinds of buffers refers to an inaccessible region of memory then an attempt to access that region will not change the buffer's content and will cause an unspecified exception to be thrown either at the time of the access or at some later time.

I open a direct ByteBuffer, use it and close it , then, open it , use it ... until there is a NullPointerException after I open it and try to use it. What is the problem? Thank you for reply.
I agree. Here's the link:
subject: A question about ByteBuffer
It's not a secret anymore!