// readRawRecord reads entire record as is and returns it
readRawRecord reads entire record as is and returns it
// readRawRecord reads entire record as is and returns it
func (r *Reader) readRawRecord() (rawValue [][]byte, err error) {
    rawLineLength := r.DigitsPerRecord * r.ColumnsPerDigit
    for i := 0; i < r.LinesPerRecord - 1; i++ {
        rawLine, _, err := r.r.ReadLine()
        if err != nil {
            return nil, err
        }
        if (len(rawLine) != rawLineLength) {
            return nil, ErrNotEnoughDigits
        }
        rawValue = append(rawValue, rawLine)
    }
    br, _, _ := r.r.ReadRune()
    if br != '\n' {
        r.r.UnreadRune()
        return nil, ErrNoBreakLine
    }
    return rawValue, nil
}
func ( r * Reader ) readRawRecord ( ) ( rawValue [ ] [ ] byte , err error ) { rawLineLength := r . DigitsPerRecord * r . ColumnsPerDigit for i := 0 ; i < r . LinesPerRecord - 1 ; i ++ { rawLine , _ , err := r . r . ReadLine ( ) if err != nil { return nil , err } if ( len ( rawLine ) != rawLineLength ) { return nil , ErrNotEnoughDigits } rawValue = append ( rawValue , rawLine ) } br , _ , _ := r . r . ReadRune ( ) if br != '\n' { r . r . UnreadRune ( ) return nil , ErrNoBreakLine } return rawValue , nil }
readRawRecord reads entire record as is and returns it
readRawRecord reads entire record as is and returns it
// possible io.EOF // ignore line break below each value, but validates // it actually exists. // fault tolerance, at least the next values could be read // in case there's no break line