code: func ClassifyStream(stream *bufio.Reader) (isArmored bool, brand string, messageType MessageType, ver Version, err error) {
  	brand, messageType, ver, err = IsSaltpackArmored(stream)
  	if err == nil {
  		return true, brand, messageType, ver, err
  	} else if err == ErrShortSliceOrBuffer {
  		return false, "", MessageTypeUnknown, Version{}, ErrShortSliceOrBuffer
  	}
  	messageType, ver, err = IsSaltpackBinary(stream)
  	if err == nil {
  		return false, "", messageType, ver, err
  	}
  	return false, "", MessageTypeUnknown, Version{}, err
  }
docs: // ClassifyStream peeks at the beginning of a stream and checks wether it seems to contain a valid
  // saltpack message (either armored or not).
  // The buffer size must be at least minLengthToIdentifyBinarySaltpack bytes for binary messages, and large
  // enough that if there is a header frame (i.e. "BEGIN FOO."), plus the first
  // base62 encoded block (43 characters) of the steam (the default buffer size of bufio.Reader
  // will be enough in most cases). Otherwise, ErrShortSliceOrBuffer will be returned.
  // If err is nil, then the expected message type and version will be returned, as well as a booleand
  // indicating if the message is ASCII-armored and the brand (for armored messages only).
  // Note this classification is just a guess based on the beginning of the stream, and it does not
  // guarantee that the message is valid or well formed.