public override int ReadContentAsBinHex( byte[] buffer, int index, int count ) {
if ( ReadState != ReadState.Interactive ) {
return 0;
}
// init ReadContentAsBinaryHelper when called first time
if ( state != State.InReadBinary ) {
readBinaryHelper = ReadContentAsBinaryHelper.CreateOrReset( readBinaryHelper, this );
savedState = state;
}
// turn off InReadBinary state in order to have a normal Read() behavior when called from readBinaryHelper
state = savedState;
// call to the helper
int readCount = readBinaryHelper.ReadContentAsBinHex( buffer, index, count );
// turn on InReadBinary state again and return
savedState = state;
state = State.InReadBinary;
return readCount;
}