コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public long write(String path, java.nio.channels.ReadableByteChannel data, ByteBuffer temporaryBuffer, boolean hasData, int requiredElementAlignment) throws java.io.IOException
        public override long Write(string path, ReadableByteChannel data, ByteBuffer temporaryBuffer, bool hasData, int requiredElementAlignment)
        {
            char[] chars = path.ToCharArray();
            _targetBuffer.writeShort(chars.Length);
            Protocol.writeChars(_targetBuffer, chars);
            _targetBuffer.writeByte(hasData ? 1 : 0);
            // TODO Make use of temporaryBuffer?
            BlockLogBuffer buffer       = new BlockLogBuffer(_targetBuffer, _bufferMonitor);
            long           totalWritten = Short.BYTES + chars.Length * Character.BYTES + Byte.BYTES;

            if (hasData)
            {
                _targetBuffer.writeInt(requiredElementAlignment);
                totalWritten += Integer.BYTES;
                totalWritten += buffer.Write(data);
                buffer.Dispose();
            }
            return(totalWritten);
        }
コード例 #2
0
 public override FlushableChannel Put(sbyte value)
 {
     @delegate.writeByte(value);
     return(this);
 }