T
tobleron
Provide us with NewECGRecord.java. Not .class, .java.
I see... here is the .java file http://www.artikelilmiah.com/NewECGRecord-Java.zip
Sorry for the misunderstanding...
Provide us with NewECGRecord.java. Not .class, .java.
tobleron said:I see... here is the .java file http://www.artikelilmiah.com/NewECGRecord-Java.zip
Sorry for the misunderstanding...
I see... here is the .java file http://www.artikelilmiah.com/NewECGRecord-Java.zip
Sorry for the misunderstanding...
....{
reader = new BufferedReader(new FileReader(file2));
String text = null;
// repeat until all lines is read
while ((text = reader.readLine()) != null)
{
contents.append(text).append(System.getProperty( "line.separator"));
jumlahline++;
}
Otherwise, why buffer entire files when you appear to be processing the
data line by line? Read from the file line by line and output each
converted line as its completed and your memory problems will vanish.
I think you could usefully break the program up into smaller methods
and investigate some way of reducing the amount of repetitive code.
while ((text = reader.readLine()) != null)
{
contents.append(text)
.append(System.getProperty(
"line.separator"));
jumlahline++;
}
In the above loop, you save the whole signal file in a StringBuffer
which you later convert to a String. You then use Scanner on that String.
I'd not append each line to a StringBuffer. I'd process each line
separately within the above loop. That way you don't have to store the
entire file in some variable, just one record.
I'm assuming it is possible to process one line independently of those
preceding or following it.
P.S. It appears you are using indentation to show the structure of the
output record and not the structure of the program. This makes it hard
to read. I think you could usefully break the program up into smaller
methods and investigate some way of reducing the amount of repetitive code.
But, I need to write the DICOM VR whith the structure like this : tag;
VR; length; value. The first loop is to find the length (jumlahline++)
and the second loop is to write the value, channel by channel (each
line contains 12 channels). If I use one loop only, how can I write
the length before the value ? The DICOM stream should be written in
sequential. Do you have another suggestion about this ?
But, I need to write the DICOM VR whith the structure like this : tag;
VR; length; value. The first loop is to find the length (jumlahline++)
and the second loop is to write the value, channel by channel (each
line contains 12 channels). If I use one loop only, how can I write
the length before the value ? The DICOM stream should be written in
sequential. Do you have another suggestion about this ?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.