Class ProcessOutput


  • public class ProcessOutput
    extends java.lang.Object
    Standard output of a finished process.
    See Also:
    ProcessExecutor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] data
      Process output (not null).
    • Constructor Summary

      Constructors 
      Constructor Description
      ProcessOutput​(byte[] data)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getBytes()  
      java.util.List<java.lang.String> getLines()  
      java.util.List<java.lang.String> getLines​(java.lang.String charset)  
      java.util.List<java.lang.String> getLinesAsUTF8()  
      (package private) static java.util.List<java.lang.String> getLinesFrom​(java.lang.String output)  
      java.lang.String getString()  
      java.lang.String getString​(java.lang.String charset)  
      java.lang.String getUTF8()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        private final byte[] data
        Process output (not null).
    • Constructor Detail

      • ProcessOutput

        public ProcessOutput​(byte[] data)
    • Method Detail

      • getBytes

        public byte[] getBytes()
        Returns:
        binary output of the finished process.
      • getString

        public java.lang.String getString()
        Returns:
        output of the finished process converted to a String using platform's default encoding.
      • getUTF8

        public java.lang.String getUTF8()
        Returns:
        output of the finished process converted to UTF-8 String.
      • getString

        public java.lang.String getString​(java.lang.String charset)
        Parameters:
        charset - The name of a supported char set.
        Returns:
        output of the finished process converted to a String.
      • getLines

        public java.util.List<java.lang.String> getLines()
        Returns:
        output lines of the finished process converted using platform's default encoding.
      • getLinesAsUTF8

        public java.util.List<java.lang.String> getLinesAsUTF8()
        Returns:
        output lines of the finished process converted using UTF-8.
      • getLines

        public java.util.List<java.lang.String> getLines​(java.lang.String charset)
        Parameters:
        charset - The name of a supported char set.
        Returns:
        output lines of the finished process converted using a given char set.
      • getLinesFrom

        static java.util.List<java.lang.String> getLinesFrom​(java.lang.String output)