final int initialPos = buffer.position();
final int bufferSize = buffer.limit() - initialPos;
if(bufferSize < serializedSize) {
throw new ProtobufReadException(MESSAGE_NAME, "Buffer corrupt, serialized size greater than remaining");
}
CodedInputStream codedInput = CodedInputStream.newInstance(buffer.array(), buffer.position(), Math.min(serializedSize, bufferSize));
try {
pbAISBuilder.mergeFrom(codedInput, storageFormatRegistry.getExtensionRegistry());
// Successfully consumed, update byte buffer
buffer.position(initialPos + serializedSize);
} catch(IOException e) {