ReaderWriter.java 635 B

123456789101112131415161718192021222324252627
  1. package de.tudarmstadt.informatik.hostage.io;
  2. import java.io.IOException;
  3. import java.util.List;
  4. /**
  5. * Interface for a generic class that offers methods for read and write.
  6. * Is used to abstract the implementation details for String and Byte protocols.
  7. * @author Mihai Plasoianu
  8. *
  9. * @param <T>
  10. */
  11. public interface ReaderWriter<T> {
  12. /**
  13. * Method to read from a medium.
  14. * @return Returns the output.
  15. * @throws IOException
  16. */
  17. T read() throws IOException;
  18. /**
  19. * Method to write to a medium.
  20. * @param outputLine The input to write.
  21. * @throws IOException
  22. */
  23. void write(List<T> outputLine) throws IOException;
  24. }