@SuppressWarnings("UnusedParameters")
public void checkHeader(String methodName, InputStream inputStream) throws IOException {
// TODO(gco): Check sequence matches and method matches.
BSONObject bsonHeader = goRpcBsonDecoder.readObject(inputStream);
if (LOGGER.isDebugEnabled()) {
String joinedBsonHeader = Joiner.on(',').withKeyValueSeparator("=").join(bsonHeader.toMap());
LOGGER.debug("bsonHeader: {}", joinedBsonHeader);
}
if (bsonHeader.containsField("Error")) {
Object error = bsonHeader.get("Error");
if (error instanceof byte[] && ((byte[]) error).length != 0) {