ReaderWriter.java 708 B

12345678910111213141516171819202122232425262728
  1. package de.tudarmstadt.informatik.hostage.io;
  2. import java.io.IOException;
  3. import java.util.List;
  4. import de.tudarmstadt.informatik.hostage.wrapper.Packet;
  5. /**
  6. * Interface for a generic class that offers methods for read and write.
  7. * Is used to abstract the implementation details for String and Byte protocols.
  8. * @author Mihai Plasoianu
  9. * @author Wulf Pfeiffer
  10. */
  11. public interface ReaderWriter {
  12. /**
  13. * Method to read from a medium.
  14. * @return Returns the output.
  15. * @throws IOException
  16. */
  17. Packet 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<Packet> outputLine) throws IOException;
  24. }