OEReadMolFromByteArrayΒΆ

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

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

Instantiates a molecule from the contents of ‘data’ in terms of ‘format’. ‘format’ must be a file extension that is readable by OpenEye, for example: ”.oeb.gz”. 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 OEIFlavor.

Returns ‘true’ if decoding was successful.

byte[] bytes = "c1ccccc1".getBytes();
OEMolBase mol = new OEGraphMol();
boolean success = oechem.OEReadMolFromByteArray(mol, ".smi", bytes);
byte[] bytes = "c1ccccc1".getBytes();
OEMolBase mol = new OEGraphMol();
boolean success = oechem.OEReadMolFromByteArray(mol, OEFormat.SMI, false, bytes);
byte[] bytes = "c1ccccc1".getBytes();
OEMolBase mol = new OEGraphMol();
boolean success = oechem.OEReadMolFromByteArray(mol, OEFormat.SMI, oechem.OEGetDefaultIFlavor(OEFormat.SMI), false, bytes);