public static ForeignException deserialize(byte[] bytes) throws IOException {
    // figure out the data we need to pass
    ForeignExceptionMessage eem = ForeignExceptionMessage.parseFrom(bytes);
    GenericExceptionMessage gem = eem.getGenericException();
    StackTraceElement[] trace = ForeignException.toStackTrace(gem.getTraceList());
    ProxyThrowable dfe = new ProxyThrowable(gem.getMessage(), trace);
    ForeignException e = new ForeignException(eem.getSource(), dfe);
    return e;
  }
Takes a series of bytes and tries to generate an ForeignException instance for it.
@return the ForeignExcpetion instance
@throws InvalidProtocolBufferException if there was deserialization problem this is thrown.
hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignException.java