//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public boolean writeHeader(BigEndianByteArrayBuffer key, BigEndianByteArrayBuffer value) throws java.io.IOException public virtual bool WriteHeader(BigEndianByteArrayBuffer key, BigEndianByteArrayBuffer value) { bool result = _state.header(this, value.AllZeroes() || value.MinusOneAtTheEnd()); DoWrite(key, value, State.Done); return(result); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void doWrite(BigEndianByteArrayBuffer key, BigEndianByteArrayBuffer value, State expectedNextState) throws java.io.IOException private void DoWrite(BigEndianByteArrayBuffer key, BigEndianByteArrayBuffer value, State expectedNextState) { this._keySize = key.Size(); this._valueSize = value.Size(); Debug.Assert(key.AllZeroes(), "key should have been cleared by previous call"); if (!Write(key, value)) { if (_state != expectedNextState) { _state = State.InError; throw new System.InvalidOperationException("MetadataCollector stopped before " + expectedNextState + " reached."); } } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void writeData(BigEndianByteArrayBuffer key, BigEndianByteArrayBuffer value) throws java.io.IOException public virtual void WriteData(BigEndianByteArrayBuffer key, BigEndianByteArrayBuffer value) { _state.data(this); Debug.Assert(key.Size() == _keySize); Debug.Assert(value.Size() == _valueSize); if (key.AllZeroes()) { _state = State.InError; throw new System.ArgumentException("All-zero keys are not allowed."); } if (!Write(key, value)) { _state = State.InError; throw new System.InvalidOperationException("MetadataCollector stopped on data field."); } }
private static bool Visitable(BigEndianByteArrayBuffer key, bool acceptZeroKey) { return(acceptZeroKey || !key.AllZeroes()); }