Pchp.Library.Streams.PhpStream.Tell C# (CSharp) Method

Tell() public method

Gets the current position in the stream.
The problem with tell() in PHP is that although the write offset is calculated in the raw byte stream (just before buffering) the read one is calculated in the filtered string buffers. In other words the value returned by tell() for output streams is the real position in the raw stream but may differ from the number of characters written. On the other hand the value returned for input streams corresponds with the number of characters retreived but not with the position in the raw stream. It is important to remember that seeking on a filtered stream (such as a file opened with a "rt" mode) has undefined behavior.
public Tell ( ) : int
return int
        public int Tell()
        {
            if (!CanSeek)
            {
                PhpException.Throw(PhpError.Warning, ErrResources.wrapper_op_unsupported, "Seek");
                return -1;
            }
            switch (currentAccess)
            {
                default:
                    // Stream not yet R/W accessed (but maybe with Seek).
                    return readOffset;
                case FileAccess.Read:
                    return ReadPosition;
                case FileAccess.Write:
                    return WritePosition;
            }
        }