You are here: com.dtsearch.engine Package > Interfaces > DataSource2 Class > DataSource2.setDocBytes Method
Close
dtSearch Engine API for Java
DataSource2.setDocBytes Method

Use setDocBytes to provide an array of bytes for dtSearch to use as the binary contents of this document.

Syntax
Java
public void setDocBytes(byte[] data);

To tell dtSearch to check for an array of bytes, the data source must return true from haveDocBytes().  

The calling program should call setDocBytes to provide the binary contents of a file to be indexed before returning from getNextDoc().  

While getDocText() can only return a stream of plain text, setDocBytes can return any type of binary data, such as the contents of a Word document or a PDF file.

Copyright (c) 1998-2021 dtSearch Corp. All rights reserved.