Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.OutputBuffer


            throw new IllegalArgumentException("path must not be null"); //$NON-NLS-1$
        }
        String result;
        InputStream input = new FileInputStream(path);
        try {
            OutputBuffer ob = new OutputBuffer();
            byte[] buf = new byte[256];
            while (true) {
                int read = input.read(buf);
                if (read < 0) {
                    break;
                }
                ob.write(buf, 0, read);
            }
            result = new String(ob.getData(), 0, ob.getLength(), ENCODING);
            ob.close();
        } finally {
            input.close();
        }
        File file = new File(result);
        return file;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.OutputBuffer

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.