fluss-server/src/main/java/com/alibaba/fluss/server/kv/snapshot/SnapshotLocation.java [157:194]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        @Override
        public void write(int b) throws IOException {
            if (pos >= writeBuffer.length) {
                flushToFile();
            }
            writeBuffer[pos++] = (byte) b;
        }

        @Override
        public void write(byte[] b, int off, int len) throws IOException {
            if (len < writeBuffer.length) {
                // copy it into our write buffer first
                final int remaining = writeBuffer.length - pos;
                if (len > remaining) {
                    // copy as much as fits
                    System.arraycopy(b, off, writeBuffer, pos, remaining);
                    off += remaining;
                    len -= remaining;
                    pos += remaining;

                    // flushToFile the write buffer to make it clear again
                    flushToFile();
                }

                // copy what is in the buffer
                System.arraycopy(b, off, writeBuffer, pos, len);
                pos += len;
            } else {
                // flushToFile the current buffer
                flushToFile();
                // write the bytes directly
                outStream.write(b, off, len);
            }
        }

        @Override
        public long getPos() throws IOException {
            return pos + (outStream == null ? 0 : outStream.getPos());
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



fluss-server/src/main/java/com/alibaba/fluss/server/log/remote/FsRemoteLogOutputStream.java [54:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public void write(int b) throws IOException {
        if (pos >= writeBuffer.length) {
            flushToFile();
        }
        writeBuffer[pos++] = (byte) b;
    }

    @Override
    public void write(byte[] b, int off, int len) throws IOException {
        if (len < writeBuffer.length) {
            // copy it into our write buffer first
            final int remaining = writeBuffer.length - pos;
            if (len > remaining) {
                // copy as much as fits
                System.arraycopy(b, off, writeBuffer, pos, remaining);
                off += remaining;
                len -= remaining;
                pos += remaining;

                // flushToFile the write buffer to make it clear again
                flushToFile();
            }

            // copy what is in the buffer
            System.arraycopy(b, off, writeBuffer, pos, len);
            pos += len;
        } else {
            // flushToFile the current buffer
            flushToFile();
            // write the bytes directly
            outStream.write(b, off, len);
        }
    }

    @Override
    public long getPos() throws IOException {
        return pos + (outStream == null ? 0 : outStream.getPos());
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



