# File lib/edi4r/edifact.rb, line 586
    def Interchange.peek(hnd=$stdin, maxlen=128) # Handle to input stream
      buf = hnd.read( maxlen )
      return nil if buf.empty?
      ic, dummy = Interchange.parse_buffer( buf, 1 )

      # Create a dummy trailer
      tag = ic.is_iedi? ? 'UIZ' : 'UNZ'
      trailer_string = tag.dup << ic.una.de_sep << '0' << ic.una.de_sep << '0'
      ic.trailer= Segment.parse(ic, trailer_string, tag)

      ic
    end