is.read(header, length, readable - length);
}
for (int i = 1; i < header.length - 1; i ++) {
if (header[i] == MAGIC_HIGH && header[i + 1] == MAGIC_LOW) {
UnsafeByteArrayInputStream bis = ((UnsafeByteArrayInputStream) is);
bis.position(bis.position() - header.length + i);
header = Bytes.copyOf(header, i);
break;
}
}
return super.decode(channel, is, readable, header);