Class FTPClient.ByteArrayDataSink

  • All Implemented Interfaces:
    DataSink
    Enclosing class:
    FTPClient

    private class FTPClient.ByteArrayDataSink
    extends java.lang.Object
    implements DataSink
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.ByteArrayOutputStream received  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this data sink and releases any system resources associated with this sink.
      java.io.ByteArrayOutputStream getData()  
      void write​(Buffer buffer)
      Writes the specified buffer to this data sink.
      • Methods inherited from class java.lang.Object

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

      • received

        private java.io.ByteArrayOutputStream received
    • Constructor Detail

      • ByteArrayDataSink

        public ByteArrayDataSink()
    • Method Detail

      • write

        public void write​(Buffer buffer)
                   throws java.io.IOException
        Description copied from interface: DataSink
        Writes the specified buffer to this data sink.
        Note: buffer.getOffset() might return -1 if the transfer mode used does not support data offsets, for example stream transfer mode.
        Specified by:
        write in interface DataSink
        Parameters:
        buffer - the data buffer to write.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: DataSink
        Closes this data sink and releases any system resources associated with this sink.
        Specified by:
        close in interface DataSink
        Throws:
        java.io.IOException - if an I/O error occurs.
      • getData

        public java.io.ByteArrayOutputStream getData()