//Read introducer as byte array to preserve any data not parsed below
byte[] introducerData = new byte[INTRODUCER_LENGTH]; //Length of introducer
din.readFully(introducerData);
Introducer introducer = new Introducer(introducerData);
int dataLength = introducer.getLength() - INTRODUCER_LENGTH;
//Handle optional extension
byte[] extData = null;
if (introducer.isExtensionPresent()) {
short extLength = 0;
extLength = (short)((din.readByte()) & 0xFF);
if (extLength > 0) {
extData = new byte[extLength - 1];
din.readFully(extData);