( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0000484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.08214094112require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.08434123104include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.08434123104get_header( $name = ???, $args = ??? ).../single.php:10
60.08434123320locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.08434123416load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.08484123960require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.08504131368wp_head( ).../header.php:18
100.08504131368do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.08504131584WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.08504131584WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.08534135000wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.08534135000do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.08534135216WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.08534135216WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.08554137104twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.08574138624wp_style_add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.php:440
190.08574138624WP_Styles->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.wp-styles.php:245
200.08574138624WP_Dependencies->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../class-wp-styles.php:385
210.08574138624_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.08584144576wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.08584264112trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0000484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.08214094112require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.08434123104include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.08434123104get_header( $name = ???, $args = ??? ).../single.php:10
60.08434123320locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.08434123416load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.08484123960require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.08504131368wp_head( ).../header.php:18
100.08504131368do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.08504131584WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.08504131584WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.08534135000wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.08534135000do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.08534135216WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.08534135216WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.08554137104twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.11354265216wp_style_add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.php:444
190.11354265216WP_Styles->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.wp-styles.php:245
200.11354265216WP_Dependencies->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../class-wp-styles.php:385
210.11354265216_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.11354265536wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.11364265760trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

Java: Reading a pdf file from URL into Byte array/ByteBuffer in an applet.

I’m trying to figure out why this particular snippet of code isn’t working for me. I’ve got an applet which is supposed to read a .pdf and display it with a pdf-renderer library, but for some reason when I read in the .pdf files which sit on my server, they end up as being corrupt. I’ve tested it by writing the files back out again.

I’ve tried viewing the applet in both IE and Firefox and the corrupt files occur. Funny thing is, when I trying viewing the applet in Safari (for Windows), the file is actually fine! I understand the JVM might be different, but I am still lost. I’ve compiled in Java 1.5. JVMs are 1.6. The snippet which reads the file is below.

public static ByteBuffer getAsByteArray(URL url) throws IOException {
        ByteArrayOutputStream tmpOut = new ByteArrayOutputStream();

        URLConnection connection = url.openConnection();
        int contentLength = connection.getContentLength();
        InputStream in = url.openStream();
        byte[] buf = new byte[512];
        int len;
        while (true) {
            len = in.read(buf);
            if (len == -1) {
                break;
            }
            tmpOut.write(buf, 0, len);
        }
        tmpOut.close();
        ByteBuffer bb = ByteBuffer.wrap(tmpOut.toByteArray(), 0,
                                        tmpOut.size());
        //Lines below used to test if file is corrupt
        //FileOutputStream fos = new FileOutputStream("C:\\abc.pdf");
        //fos.write(tmpOut.toByteArray());
        return bb;
}

I must be missing something, and I’ve been banging my head trying to figure it out. Any help is greatly appreciated. Thanks.

 


 

Edit: To further clarify my situation, the difference in the file before I read then with the snippet and after, is that the ones I output after reading are significantly smaller than they originally are. When opening them, they are not recognized as .pdf files. There are no exceptions being thrown that I ignore, and I have tried flushing to no avail.

This snippet works in Safari, meaning the files are read in it’s entirety, with no difference in size, and can be opened with any .pdf reader. In IE and Firefox, the files always end up being corrupted, consistently the same smaller size.

I monitored the len variable (when reading a 59kb file), hoping to see how many bytes get read in at each loop. In IE and Firefox, at 18kb, the in.read(buf) returns a -1 as if the file has ended. Safari does not do this.

I’ll keep at it, and I appreciate all the suggestions so far.

 

come from : http://stackoverflow.com/questions/637100/java-reading-a-pdf-file-from-url-into-byte-array-bytebuffer-in-an-applet

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.