Java Buffer / Stream

From: Mikee29 Mar 2012 12:49
To: Mikee 2 of 4
Seems I've sorted it..

java code:
 
        ByteBuffer buf = ByteBuffer.allocate(LEN_DATA);
        fc.read(buf, recordOffset + dataOffset);
        buf.position(0);
        byte[] bytearr = new byte[buf.remaining()];
        buf.get(bytearr);
        String strElevation = new String(bytearr);
        return Integer.parseInt(strElevation);
 


Ugh!
From: Peter (BOUGHTONP)29 Mar 2012 14:19
To: Mikee 3 of 4
Are you forced to use Java language?

'Cus there are JVM languages that'll make that as simple as:
code:
data = readFile(name);
elevation = data[4];
From: Mikee29 Mar 2012 14:24
To: Peter (BOUGHTONP) 4 of 4
Uh. I'm guessing so, yeah