OEReadMolFromByteArrayΒΆ

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

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

Interprets a molecule from the contents of ‘data’ in terms of ‘format’. ‘format’ must be a file extension that is both readable by OpenEye. For example: ”.oeb.gz”. The overloads which take a Boolean ‘gzip’ parameter expect format to be specified by one of the constants in OEFormat.

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);