/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Stream = require("./../../../unisharp/Stream");

/**
 * An <see cref="UncompressedStream"/> is a stream that you can write uncompressed data 
 * to and flush, but cannot read, seek or do anything else to.
 */
class UncompressedStream extends Stream {
    
    constructor(baseStream) {
        super();
        this.baseStream_ = null;
        this.baseStream_ = baseStream;
    }
    
    /**
     * Close this stream instance.
     */
    close() {
        
    }
    
    get canRead() {
        return false;
    }
    
    /**
     * Write any buffered data to underlying storage.
     */
    flush() {
        this.baseStream_.flush();
    }
    
    get canWrite() {
        return this.baseStream_.canWrite();
    }
    
    get canSeek() {
        return false;
    }
    
    get length() {
        return 0;
    }
    
    get position() {
        return this.baseStream_.position;
    }
    set position(value) {
        return value;
    }
    
    /**
     * Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
     * @param buffer An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
     * @param offset The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
     * @param count The maximum number of bytes to be read from the current stream.
     * @return The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
     */
    read(buffer, offset, count) {
        return 0;
    }
    
    /**
     * Sets the position within the current stream.
     * @param offset A byte offset relative to the origin parameter.
     * @param origin A value of type <see cref="T:System.IO.SeekOrigin"></see> indicating the reference point used to obtain the new position.
     * @return The new position within the current stream.
     */
    seek(offset, origin) {
        return 0;
    }
    
    /**
     * Sets the length of the current stream.
     * @param value The desired length of the current stream in bytes.
     */
    setLength(value) {
        
    }
    
    /**
     * Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
     * @param buffer An array of bytes. This method copies count bytes from buffer to the current stream.
     * @param offset The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
     * @param count The number of bytes to be written to the current stream.
     */
    write(buffer, offset, count) {
        this.baseStream_.write(buffer, offset, count);
    }
}


module.exports = UncompressedStream