Coder Social home page Coder Social logo

fileio's Introduction

File Input and Output

I ran the tasks on a MacBook Pro, and got these results:

Task Time
1.) Copy file one byte at a time. 0.092714 sec
2.) Copy a file using a byte array of size 8 Bytes 0.013946 sec
3.) Copy a file using a byte array of size 32 Bytes 0.003638 sec
4.) Copy a file using a byte array of size 512 Bytes 0.000368 sec
5.) Copy a file using BufferedReader and PrintWriter 0.004953 sec

Explanation of Results

4th task is the fastest run time because 4th task can copy many file more than 1st, 2nd, 3rd and 5th task at a time. The first task is the slowest task because it can copy file just only one byte at a time. In case of 5th task, it's need a little time to covert from byte to String. For a file using a byte array will faster if you increase size of a byte array because you reserved memory location to copy a file.

fileio's People

Contributors

nottpty avatar

Watchers

James Cloos avatar Chinthiti Wisetsombat avatar  avatar

fileio's Issues

Avoid magic number

Best practice to avoid a magic number.
It can be refactored to static final attribute.

here

WIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.