code: public static AbstractJournalOperation readJournalOperation( DataInputStream in )
  	{
  		try
  		{
  			int operationType = in.read();
  			if (operationType == -1)
  				return null; // EOF
  	
  			switch (operationType)
  			{
  				case 0 : // Padding
  					return null;
  				
  				case AbstractJournalOperation.TYPE_META_DATA_WRITE :
  					return readMetaDataWriteOperation(in);
  					
  				case AbstractJournalOperation.TYPE_META_DATA_BLOCK_WRITE :
  					return readMetaDataBlockWriteOperation(in);
  					
  				case AbstractJournalOperation.TYPE_DATA_BLOCK_WRITE :
  					return readDataBlockWriteOperation(in);
  					
  				case AbstractJournalOperation.TYPE_STORE_EXTEND :
                      return readStoreExtendOperation(in);
  					
  				case AbstractJournalOperation.TYPE_COMMIT :
  					return readCommitOperation(in);
  					
  				default:
  					throw new IllegalArgumentException("Invalid operation type : "+operationType);
  			}
  		}
  		catch (Exception e)
  		{
  			log.error("Corrupted or truncated journal operation, skipping.",e);
  			return null;
  		}
  	}
docs: -------------------------------------------------------------------------