code: private void read(InputStream is, Table table) throws IOException
     {
        byte[] headerBytes = new byte[6];
        is.read(headerBytes);
  
        byte[] recordCountBytes = new byte[2];
        is.read(recordCountBytes);
        //int recordCount = getShort(recordCountBytes, 0);
        //System.out.println("Header: " + new String(headerBytes) + " Record count:" + recordCount);
  
        byte[] buffer = new byte[m_definition.getRecordSize()];
        while (true)
        {
           int bytesRead = is.read(buffer);
           if (bytesRead == -1)
           {
              break;
           }
  
           if (bytesRead != buffer.length)
           {
              throw new IOException("Unexpected end of file");
           }
  
           if (buffer[0] == 0)
           {
              readRecord(buffer, table);
           }
        }
     }
docs: Read the table from an input stream and populate the supplied Table instance.
  
  @param is input stream from table file
  @param table Table instance