Package javax.microedition.io.file

Examples of javax.microedition.io.file.FileConnection.openOutputStream()


      if (image != null)
      {
        PNGEncodedImage encodedImage = PNGEncodedImage.encode(image);
        byte[] imageBytes = encodedImage.getData();
        OutputStream out = fconn.openOutputStream();
        out.write(imageBytes);
        out.close();
        result = true;
      }
View Full Code Here


                      fconn = (FileConnection)Connector.open(filePath+"//"+fileName+"."+fileExtension, Connector.READ_WRITE);
                    }
        
                    fconn.create();

                    OutputStream outputStream = fconn.openOutputStream();
                    EncodedImage encodedImage;
                    if(fileExtension.equals("jpg") || fileExtension.equals("jpeg")){
                      encodedImage = JPEGEncodedImage.encode(b, 100);
                    }else{
                      encodedImage = PNGEncodedImage.encode(b);
View Full Code Here

        final FileConnection conn = (FileConnection) Connector.open(rootPrefix + fileName);
        try {
            if (!conn.exists()) {
                conn.create();
            }
            final OutputStream out = conn.openOutputStream();
            try {
                out.write(data);
                out.flush();
            } finally {
                out.close();
View Full Code Here

        // Reopen the output file
        FileConnection conn = (FileConnection) Connector.open( _path, Connector.READ_WRITE );
        int size = (int) conn.fileSize();

        // use output stream as it is shown in the sample
        OutputStream o = conn.openOutputStream();

        //*********************************************************************************************************************
        //*****************************************************************************    NAME            Endedness       Size
        //*********************************************************************************************************************
        // RIFF Chunk Descriptor
View Full Code Here

            }

            conn.create();

            // use output stream as it is shown in the sample
            _output = conn.openOutputStream();

            // Leave 44 bytes for the WAV header
            if( _type == TYPE_WAV ) {
                for( int i = 0; i < 44; i++ ) {
                    _output.write( 0 );
View Full Code Here

    public OutputStream openOutputStream() throws IOException
    {
        final FileConnection connection = (FileConnection)Connector.open( PREFIX + path_ );
        if( !connection.exists() )
            connection.create();
        final OutputStream stream = connection.openOutputStream();
        connection.close();
        return stream;
    }

    /**
 
View Full Code Here

                        // We know the file doesn't exist yet, so create it
                        file.create();

                        // Write the image to the file
                        final OutputStream out = file.openOutputStream();
                        out.write(_raw);

                        // Close the connections
                        out.close();
                        file.close();
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.