OEWriteMolToByteArray

byte[] OEWriteMolToByteArray(String format, OEMolBase mol)
byte[] OEWriteMolToByteArray(int format, boolean gzip, OEMolBase mol)
byte[] OEWriteMolToByteArray(int format, int flavor, boolean gzip, OEMolBase mol)

byte[] OEWriteMolToByteArray(String format, OEMCMolBase mol)
byte[] OEWriteMolToByteArray(int format, boolean gzip, OEMCMolBase mol)
byte[] OEWriteMolToByteArray(int format, int flavor, boolean gzip, OEMCMolBase mol)

Encodes a molecule in terms of ‘format’. ‘format’ must be a file extension that is writeable by OpenEye, for example: “.oeb.gz”. The overloads which take a Boolean ‘gzip’ parameter or an unsigned ‘flavor’ and Boolean ‘gzip’ parameters expect the format or the format and flavor to be specified by one of the constants in OEFormat and OEOFlavor.

Returns a non-empty byte[] if encoding was successful.

OEMolBase mol = new OEGraphMol();
oechem.OESmilesToMol(mol, "c1ccccc1");
byte[] bytes = oechem.OEWriteMolToByteArray(".oeb", mol);
OEMolBase mol = new OEGraphMol();
oechem.OESmilesToMol(mol, "c1ccccc1");
byte[] bytes = oechem.OEWriteMolToByteArray(OEFormat.OEB, false, mol);
OEMolBase mol = new OEGraphMol();
oechem.OESmilesToMol(mol, "c1ccccc1");
byte[] bytes = oechem.OEWriteMolToByteArray(OEFormat.OEB, oechem.OEGetDefaultOFlavor(OEFormat.OEB), false, mol);