func DetectDataType(r io.Reader) (DataType, error) {
	buff := make([]byte, 6)
	if _, err := r.Read(buff); err != nil {
		return DataTypeInvalid, err
	}

	// Match known signatures
Outer:
	for dt, sig := range byteCodeSigs {
		for position := range sig {
			if buff[position] != sig[position] {
				continue Outer
			}
		}
		return dt, nil
	}

	return DataTypeNoCompression, nil
}
// DetectDataType attempts to detect the data type of a stream by checking
// against a set of known data types.  Byte code signatures from
// https://stackoverflow.com/a/19127748/199475
DetectDataType attempts to detect the data type of a stream by checking
against a set of known data types.
// DetectDataType attempts to detect the data type of a stream by checking // against a set of known data types . Byte code signatures from // https : // stackoverflow . com / a / 19127748 / 199475
func DetectDataType(r io.Reader) (DataType, error) {
	buff := make([]byte, 6)
	if _, err := r.Read(buff); err != nil {
		return DataTypeInvalid, err
	}
Outer:
	for dt, sig := range byteCodeSigs {
		for position := range sig {
			if buff[position] != sig[position] {
				continue Outer
			}
		}
		return dt, nil
	}
	return DataTypeNoCompression, nil
}
func DetectDataType ( r io . Reader ) ( DataType , error ) { buff := make ( [ ] byte , 6 ) if _ , err := r . Read ( buff ) ; err != nil { return DataTypeInvalid , err } Outer : for dt , sig := range byteCodeSigs { for position := range sig { if buff [ position ] != sig [ position ] { continue Outer } } return dt , nil } return DataTypeNoCompression , nil }
DetectDataType attempts to detect the data type of a stream by checking
against a set of known data types.
DetectDataType attempts to detect the data type of a stream by checking against a set of known data types .
// Match known signatures