validateJpgBuffer method

bool validateJpgBuffer (
  1. int i
)

Assure jpg buffer structure is right

Implementation

bool validateJpgBuffer(int i) {
  // index should be within buffer limits
  if (i > codeUnits.length) return false;
  // Every JPEG block must begin with a 0xFF
  if (codeUnits[i] != 255) return false;
  return true;
}