try { FieldType<?> fieldType = FieldType.get(fieldTypeIdx); if (fieldType.checksStream() && fieldType != this) { throw new IllegalStateException("Mismatch in stream: expected " + this + " but got " + fieldType);
try { FieldType<?> fieldType = FieldType.get(fieldTypeIdx); if (fieldType.checksStream() && fieldType != this) { throw new IllegalStateException("Mismatch in stream: expected " + this + " but got " + fieldType);
public final T read(DataInputExtended input) throws IOException { DataInputStream inputStream = input.getDataInputStream(); byte fieldTypeIdxAndNullability = inputStream.readByte(); boolean isNull = fieldTypeIdxAndNullability >= NULL_BIT; byte fieldTypeIdx = (byte) (fieldTypeIdxAndNullability - (isNull ? NULL_BIT : 0)); try { FieldType<?> fieldType = FieldType.get(fieldTypeIdx); if (fieldType.checksStream() && fieldType != this) { throw new IllegalStateException("Mismatch in stream: expected " + this + " but got " + fieldType); } if (isNull && LOG.isDebugEnabled()) { // only log if reading a null; otherwise actual value read logged later log(this, new StringBuilder().append("(null)")); } if (isNull) { return null; } else { return doRead(input); } } finally { if (isNull && LOG.isDebugEnabled()) { // only unlog if reading a null unlog(this); } } }
public final T read(DataInputExtended input) throws IOException { DataInputStream inputStream = input.getDataInputStream(); byte fieldTypeIdxAndNullability = inputStream.readByte(); boolean isNull = fieldTypeIdxAndNullability >= NULL_BIT; byte fieldTypeIdx = (byte) (fieldTypeIdxAndNullability - (isNull ? NULL_BIT : 0)); try { FieldType<?> fieldType = FieldType.get(fieldTypeIdx); if (fieldType.checksStream() && fieldType != this) { throw new IllegalStateException("Mismatch in stream: expected " + this + " but got " + fieldType); } if (isNull && LOG.isDebugEnabled()) { // only log if reading a null; otherwise actual value read logged later log(this, new StringBuilder().append("(null)")); } if (isNull) { return null; } else { return doRead(input); } } finally { if (isNull && LOG.isDebugEnabled()) { // only unlog if reading a null unlog(this); } } }