Read a file with 2048 bytes
- by Suresh S
Guys i have a file which has only one line. The file has no encoding it is a simple text file with single line.
For every 2048 byte in a line , there is new record of 151 byte (totally 13*151 byte = 1945 records + 85 byte empty space). similarly for the next 2048 bytes.
What is the best file i/o to use? i am thinking of reading 2048 bytes from file and storing it
in an array .
while (offset < fileLength &&(numRead=in.read(recordChunks, offset,alength)) >= 0)
{
}
how can i get from the read statement only 2048 bytes at a time . i am getting IndexOutofBoundException.