public static String read4Chars(RandomAccessFile raf) throws IOException {
  StringBuffer sbuf=new StringBuffer(4);
  for (int i=0; i < 4; i++) {
    char ch=(char)raf.read();
    sbuf.append(ch);
  }
  return sbuf.toString();
}

public static String read4Chars ( RandomAccessFile raf ) throws IOException { StringBuffer sbuf = new StringBuffer ( 4 ) ; for ( int i = 0 ; i < 4 ; i ++ ) { char ch = ( char ) raf . read ( ) ; sbuf . append ( ch ) ; } return sbuf . toString ( ) ; }
reads 4 bytes and concatenates them into a string . this pattern is used for id ' s of various kinds .
