func NewWithDataSpan(data []byte) (swarm.Chunk, error) {
	dataLength := len(data)
	if dataLength > swarm.ChunkSize+swarm.SpanSize {
		return nil, errTooLargeChunkData
	}

	if dataLength < swarm.SpanSize {
		return nil, errTooShortChunkData
	}
	return newWithSpan(data[swarm.SpanSize:], data[:swarm.SpanSize])
}
// NewWithDataSpan creates a new chunk assuming that the span precedes the actual data.
NewWithDataSpan creates a new chunk assuming that the span precedes the actual data.
// NewWithDataSpan creates a new chunk assuming that the span precedes the actual data .
func NewWithDataSpan(data []byte) (swarm.Chunk, error) {
	dataLength := len(data)
	if dataLength > swarm.ChunkSize+swarm.SpanSize {
		return nil, errTooLargeChunkData
	}
	if dataLength < swarm.SpanSize {
		return nil, errTooShortChunkData
	}
	return newWithSpan(data[swarm.SpanSize:], data[:swarm.SpanSize])
}
func NewWithDataSpan ( data [ ] byte ) ( swarm . Chunk , error ) { dataLength := len ( data ) if dataLength > swarm . ChunkSize + swarm . SpanSize { return nil , errTooLargeChunkData } if dataLength < swarm . SpanSize { return nil , errTooShortChunkData } return newWithSpan ( data [ swarm . SpanSize : ] , data [ : swarm . SpanSize ] ) }
NewWithDataSpan creates a new chunk assuming that the span precedes the actual data.
NewWithDataSpan creates a new chunk assuming that the span precedes the actual data .