Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. package de.unistuttgart.iaas.icetea.io;
  2.  
  3. import java.io.FileOutputStream;
  4. import java.io.IOException;
  5. import java.io.ObjectOutputStream;
  6.  
  7. public class BinaryFileWriter extends ObjectOutputStream {
  8.  
  9. private String filePath;
  10.  
  11. /**
  12. * Standard constructor
  13. * @param filePath
  14. * @throws IOException
  15. * @throws SecurityException
  16. */
  17. public BinaryFileWriter(String filePath) throws IOException, SecurityException {
  18. super(new FileOutputStream(filePath));
  19. this.filePath = filePath;
  20. }
  21.  
  22. public String getPath() {
  23. return this.filePath;
  24. }
  25.  
  26. public void write(Object... objects) throws IOException {
  27. Object[] obj = objects;
  28.  
  29. for(Object o : obj) {
  30. writeObject(o);
  31. }
  32. close();
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement