String fileName = "test.txt";
File file = new File(fileName);
FileInputStream fin = new FileInputStream(file);
byte byteArray = new byte[(int)file.length()];
Friday, June 24, 2011
Java: read data as byte array from file
Using the FileInputStream of java, you can read data from a file into a byte array. Below is the sample code that will fill the byte array from the provided file.
This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...
Many other programming languages, Python does have the comparator facility to sort a list according to your need. You can define a customize...
Sometimes you may need to run the wget under a silent mode, means it will not display any output on the screen while executing. Usually the ...