func (s *SegmentExtractor) Extract() ([][]byte, error) {
	var current []byte
	lexer := token.NewLexer("SegmentExtractor", s.rawMessage)
	for lexer.HasNext() {
		t := lexer.Next()
		if t.Type() == token.ERROR {
			return nil, fmt.Errorf("%T: SyntaxError at position %d: %q\n(%q)", s, t.Pos(), t.Value(), s.rawMessage)
		}
		current = append(current, t.Value()...)
		if t.Type() == token.SEGMENT_END_MARKER {
			s.segments = append(s.segments, current)
			current = []byte{}
		}
	}
	result := make([][]byte, len(s.segments))
	copy(result, s.segments)
	return result, nil
}
// Extract extract segment byte slices from the message. It will return a copy
// of the result so it is safe to manipulate it
Extract extract segment byte slices from the message. It will return a copy
of the result so it is safe to manipulate it
// Extract extract segment byte slices from the message . It will return a copy // of the result so it is safe to manipulate it
func (s *SegmentExtractor) Extract() ([][]byte, error) {
	var current []byte
	lexer := token.NewLexer("SegmentExtractor", s.rawMessage)
	for lexer.HasNext() {
		t := lexer.Next()
		if t.Type() == token.ERROR {
			return nil, fmt.Errorf("%T: SyntaxError at position %d: %q\n(%q)", s, t.Pos(), t.Value(), s.rawMessage)
		}
		current = append(current, t.Value()...)
		if t.Type() == token.SEGMENT_END_MARKER {
			s.segments = append(s.segments, current)
			current = []byte{}
		}
	}
	result := make([][]byte, len(s.segments))
	copy(result, s.segments)
	return result, nil
}
func ( s * SegmentExtractor ) Extract ( ) ( [ ] [ ] byte , error ) { var current [ ] byte lexer := token . NewLexer ( " " , s . rawMessage ) for lexer . HasNext ( ) { t := lexer . Next ( ) if t . Type ( ) == token . ERROR { return nil , fmt . Errorf ( " \n " , s , t . Pos ( ) , t . Value ( ) , s . rawMessage ) } current = append ( current , t . Value ( ) ... ) if t . Type ( ) == token . SEGMENT_END_MARKER { s . segments = append ( s . segments , current ) current = [ ] byte { } } } result := make ( [ ] [ ] byte , len ( s . segments ) ) copy ( result , s . segments ) return result , nil }
Extract extract segment byte slices from the message.
Extract extract segment byte slices from the message .