i want to read a value from that record
What format is that value in? Where is the first byte of the value and how many bytes does use.
Note: The variable named: recLength should be given a name that describes what it holds. It looks like the variable named: size holds the record's length. A better name might be theRecord or buffer.
I suggest that you write a small
testing program to work out the classes and methods for extracting data from an array of bytes. Here are some useful tools:
System.out.println("an ID "+ java.util.Arrays.toString(theArrayName)); // display the contents of an array
ByteArrayOutputStream - use this to write some test data into a byte array for testing the code to read from the array
ByteArrayInputStream - use to create an InputStream from a byte array. That InputStream can be used with higher level classes to access the data in the bytes.