Package edu.sdsc.grid.io.srb

Examples of edu.sdsc.grid.io.srb.SRBFileOutputStream


        //boolean d = file.delete();
        //file.createNewFile();
        File filefrom = new File("/tmp/from.txt");
        assertTrue(filefrom.exists());

        SRBFileOutputStream to = null;
        InputStream from = null;
        try {
            to = new SRBFileOutputStream((SRBFile) file);
            from = new FileInputStream(filefrom);
            byte[] buffer = new byte[4096];
            int bytes_read;

            while ((bytes_read = from.read(buffer)) != -1) {
                to.write(buffer, 0, bytes_read);
            }
           
            //String content = "123456789";
            //byte[] bytes = content.getBytes();
            //to.write(bytes);
            to.flush();
       
        } finally {
            try {
                if (to != null) {
                    to.close();
                }
            } catch (Exception ex) {
            }
            try {
                if (from != null) {
View Full Code Here


     * @throws java.lang.Exception
     */
    @Override
    protected OutputStream doGetOutputStream(boolean append) throws Exception {
        // todo: need to support the append
        SRBFileOutputStream os = new SRBFileOutputStream((SRBFile) file);
        //DataOutputStream out = new DataOutputStream(os);
        return os;
    }
View Full Code Here

TOP

Related Classes of edu.sdsc.grid.io.srb.SRBFileOutputStream

Copyright © 2018 www.massapicom. 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.