Method: Ftpd::Stream#write

Defined in:
lib/ftpd/stream.rb

#write(io) ⇒ Object

Convert and write a chunk of up to CHUNK_SIZE to the stream from the provided IO object

Parameters:

  • io (IO)

    The data to be written to the stream



35
36
37
38
39
40
41
42
# File 'lib/ftpd/stream.rb', line 35

def write(io)
  while chunk = converted_chunk(io)
    chunk = unix_to_nvt_ascii(chunk) if data_type == 'A'
    result = @io.write(chunk)
    record_bytes(chunk)
    result
  end
end