private static void checkLimit(Buffer buffer) {
        if (buffer == null) {
            return;
        }
        if (buffer.limit() == 0) {
            throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error");
        }
        if (buffer.remaining() == 0) {
            throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error");
        }
    }
Implements OpenGL ES 2.0 and 3.0 for iOS. 

@author Kirill Vainer, Jesus Oliver
jme3-ios/src/main/java/com/jme3/renderer/ios/IosGL.java