Fixed UnsupportedOperationException with a direct buffer