private void guessTransferSyntax() throws IOException {
byte[] b132 = new byte[132];
mark(132);
int rlen = StreamUtils.readAvailable(this, b132, 0, 132);
if (rlen == 132) {
if (b132[128] == 'D' && b132[129] == 'I' && b132[130] == 'C' && b132[131] == 'M') {
preamble = new byte[128];
System.arraycopy(b132, 0, preamble, 0, 128);
if (!markSupported()) {
hasfmi = true;
tsuid = UID.ExplicitVRLittleEndian;
bigEndian = false;
explicitVR = true;
return;
}
mark(132);
rlen = StreamUtils.readAvailable(this, b132, 0, 132);
}
}
if (rlen < 8
|| !guessTransferSyntax(b132, rlen, false)
&& !guessTransferSyntax(b132, rlen, true))
throw new DicomStreamException(NOT_A_DICOM_STREAM);
reset();
hasfmi = TagUtils.isFileMetaInformation(
ByteUtils.bytesToTag(b132, 0, bigEndian));
}