Package blackberry.io

Examples of blackberry.io.FileConnectionWrapper.openDataInputStream()


     *            or the src path is to an directory; if reading is asynchronous,
     *            no exceptions will be thrown when an error occurs
     */
    public Object execute( Object thiz, Object[] args ) throws Exception {
        FileConnectionWrapper fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );
        fConnWrap.openDataInputStream();

        if( args.length == 2 || ( args.length == 3 && ( (Boolean) args[ 2 ] ).booleanValue() ) ) { // Async read
            new Thread( new AsyncRead( this, fConnWrap, args[ 0 ].toString(), (ScriptableFunction) args[ 1 ] ) ).start();
        } else { // Sync read
            read( this, fConnWrap, args[ 0 ].toString(), (ScriptableFunction) args[ 1 ] );
View Full Code Here


            // get the character encoding by scanning the first 2-4 bytes
            byte[] data = null;
            if( size.intValue() >= 2 ) {
                data = new byte[ 4 ];
                DataInputStream dis = fConnWrap.openDataInputStream();
                dis.read( data, 0, 4 ); // IOException may be thrown
            }
            String encoding = getEncoding( data );
            fileProObj = new FilePropertiesObject( isReadonly, isHidden, size, null, dateModified, fileExtension, directory,
                    mimeType, encoding );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.