@Test public final void testInvalidData() { ByteArray invalidBinLoc = new ByteArray(INVALID_BIN_LOC_DATA); try { decodeData(invalidBinLoc); } catch (PhysicalFormatException e) { fail("failed on invalid input"); } }
@Override public RawLocationReference decodeData(final LocationReference lr) throws PhysicalFormatException { Object data = lr.getLocationReferenceData(); if (data == null || !(data instanceof ByteArray)) { throw new OpenLRBinaryException( PhysicalFormatError.INVALID_BINARY_DATA); } ByteArray dataList = (ByteArray) data; return parseBinaryData(lr.getID(), dataList.getData(), null); }
OpenLRBinaryDecoder implements PhysicalDecoder { @Override public RawLocationReference decodeData(final LocationReference lr) throws PhysicalFormatException { Object data = lr.getLocationReferenceData(); if (data == null || !(data instanceof ByteArray)) { throw new OpenLRBinaryException( PhysicalFormatError.INVALID_BINARY_DATA); } ByteArray dataList = (ByteArray) data; return parseBinaryData(lr.getID(), dataList.getData(), null); } }
OpenLRBinaryDecoder implements PhysicalDecoder { @Override public RawLocationReference decodeData(final LocationReference lr) throws PhysicalFormatException { Object data = lr.getLocationReferenceData(); if (data == null || !(data instanceof ByteArray)) { throw new OpenLRBinaryException( PhysicalFormatError.INVALID_BINARY_DATA); } ByteArray dataList = (ByteArray) data; return parseBinaryData(lr.getID(), dataList.getData(), null); }  }
OpenLRBinaryDecoder implements PhysicalDecoder { @Override public RawLocationReference decodeData(final LocationReference lr) throws PhysicalFormatException { Object data = lr.getLocationReferenceData(); if (data == null || !(data instanceof ByteArray)) { throw new OpenLRBinaryException( PhysicalFormatError.INVALID_BINARY_DATA); } ByteArray dataList = (ByteArray) data; return parseBinaryData(lr.getID(), dataList.getData(), null); }  static int[] getVersions(); @Override RawLocationReference decodeData(final LocationReference lr); @Override Class<?> getDataClass(); @Override String getDataFormatIdentifier(); RawBinaryData resolveBinaryData(final String id, final ByteArray ba); }
OpenLRBinaryDecoder implements PhysicalDecoder { @Override public RawLocationReference decodeData(final LocationReference lr) throws PhysicalFormatException { Object data = lr.getLocationReferenceData(); if (data == null || !(data instanceof ByteArray)) { throw new OpenLRBinaryException( PhysicalFormatError.INVALID_BINARY_DATA); } ByteArray dataList = (ByteArray) data; return parseBinaryData(lr.getID(), dataList.getData(), null); }  static int[] getVersions(); @Override RawLocationReference decodeData(final LocationReference lr); @Override Class<?> getDataClass(); @Override String getDataFormatIdentifier(); RawBinaryData resolveBinaryData(final String id, final ByteArray ba);  }