public byte[] readAsBytes() throws DescriptorIOException { try { return FileUtils.readFileToByteArray(new File(locator.getURI().getPath())); } catch (IOException ex) { throw new DescriptorIOException("Cannot read descriptor: " + locator.getLastName(), ex); } }
public String readAsString() throws DescriptorIOException { byte[] encoded = this.readAsBytes(); try { return new String(encoded, DescriptorWriter.CHARSET); } catch (UnsupportedEncodingException e) { throw new DescriptorIOException("Cannot read from: " + locator.toString(), e); } }