Code example for InvalidObjectException

0
		in.defaultReadObject();
		texture = ByteBuffer.wrap((byte[]) in.readObject());
	} 
 
	private void readObjectNoData() throws ObjectStreamException { 
		throw new InvalidObjectException("Stream data required");
	} 
 
	@Override 
	// Gets first xml file, then image referenced by it 
	public boolean importRawFromFolder(File f) throws IOException {
		File xml = null, image = null;
		File[] files = f.listFiles();
		for (File file : files) {
			if (file.isFile()
					&& FilenameUtils.getExtension(file.getName()).equals("xml")) {
				xml = file;
				break; 
			} 
		} 
		if (xml == null) {