# US 10,768,861 B1 · In-place safe decompression

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,768,861 B1
- Document ID: US10768861B1
- Status: Granted
- Kind: B1
- Application number: 16/287,837
- Filed: 2019-02-27
- Published: 2020-08-27
- Granted: 2020-09-08
- Earliest claimed: 2019-02-27
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Xin Huang; Derek E. Gladding; Bartosz T. Nyczkowski; Michael Sterling
- Web page: https://patentgrep.com/patent/US10768861B1

## CPC

- G06F 3/0661: {Format or protocol conversion arrangements}
- H03M 7/6058: {Saving memory space in the encoder or decoder}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0631: {by allocating resources to storage systems}
- G06F 3/0673: {Single storage device}
- G06F 16/1744: {using compression, e.g. sparse files}
- H03M 7/6005: {Decoder aspects}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

A method for providing in-place safe decompression of a data stream includes utilizing a stored offset to allocate a memory space for a decompression operation. The stored offset represents a maximum offset by which a write pointer position of an output stream exceeds a read pointer position for a corresponding input stream during in-place decompression of the compressed data stream.

## Claims

### Claim 1

A method comprising:
processing an instruction to decompress a compressed data stream stored in association with an in-place safe (IPS) offset, the IPS offset representing a maximum offset by which a write pointer position of an output stream exceeds a read pointer position for a corresponding input stream during in-place decompression of the compressed data stream;
allocating a memory space for storing the input stream and the output stream during the in-place decompression of the compressed data stream, the memory space having a size selected based on the IPS offset and a size of the output stream; and
decompressing the compressed data stream in-place within the allocated memory space.

### Claim 2 (depends on 1)

The method of claim 1, wherein the size of the allocated memory space is equal to a sum of the IPS offset and the size of the output stream.

### Claim 3 (depends on 1)

The method of claim 1, wherein the IPS offset further represents the maximum offset by which the write pointer position of the output stream exceeds the read pointer position for the input stream when a write pointer for the output stream is initialized at a zero value and read pointer for the input stream is initialized at a value equal to a difference between a length of the output stream and a length of the input stream.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
reading the data of the compressed data stream sequentially into a continuous end portion of the allocated memory space, the continuous end portion corresponding with an end portion of the allocated memory space.

### Claim 5 (depends on 1)

The method of claim 1, wherein a last byte in the compressed data stream is stored in a last physical block in the allocated memory space.

### Claim 6 (depends on 1)

The method of claim 1, wherein decompressing the compressed data stream in-place further comprises sequentially writing values of the output stream starting at a first data block in the allocated memory space.

### Claim 7 (depends on 1)

The method of claim 1, wherein the memory space is a continuous sequence of sequential physical blocks.

### Claim 8

A system comprising:
memory; and
an in-place safe (IPS) offset determination tool stored in the memory that:
tracks locations of a read pointer and a writer pointer while decompressing a compressed data stream; and
identifies, based on the tracked locations, an IPS offset representing a maximum offset by which a position of the write pointer exceeds a position of the read pointer;
a file generator stored in the memory that stores the compressed data stream in association with a location of IPS offset; and
a file reader stored in the memory that allocates a memory space for decompression of the compressed data stream, the memory space having a size based on the IPS offset.

### Claim 9 (depends on 8)

The system of claim 8, wherein the size of the memory space is equal to a sum of the IPS offset and a size of a decompressed data stream saved in association with the compressed data stream.

### Claim 10 (depends on 8)

The system of claim 8, wherein the memory space is a continuous sequence of sequential physical blocks.

### Claim 11 (depends on 8)

The system of claim 8, wherein the IPS offset determination tool tracks locations of the read pointer and the write pointer by:
initializing a write pointer to a zero index equal;
initializing a read pointer to an index equal to a difference between an expected length of a decompressed data stream and a length of the compressed data stream;
updating the read pointer with each byte of data that is read from the compressed data stream; and
updating the write pointer with each byte of data that is written to the decompressed data stream.

### Claim 12 (depends on 8)

The system of claim 8, wherein the IPS offset and the compressed data stream are stored in same data file.

### Claim 13 (depends on 12)

The system of claim 12, wherein the file reader is stored along with the data file and selectively executable to for download by a user device.

### Claim 14

One or more memory devices storing processor-readable instructions for executing a computer process comprising:
processing an instruction to decompress a compressed data stream stored in association with an in-place safe (IPS) offset, the IPS offset representing a maximum offset by which a write pointer position of an output stream exceeds a read pointer position for a corresponding input stream during in-place decompression of the compressed data stream;
allocating a memory space for storing the input stream and the output stream during the in-place decompression of the compressed data stream, the memory space having a size selected based on the IPS offset and a size of the output stream; and
decompressing the compressed data stream in-place within the allocated memory space.

### Claim 15 (depends on 14)

The one or more memory devices of claim 14, wherein the size of the allocated memory space is equal to a sum of the IPS offset and the size of the output stream.

### Claim 16 (depends on 14)

The one or more memory devices of claim 14, wherein the IPS offset further represents the maximum offset by which the write pointer position of the output stream exceeds the read pointer position for the input stream when a write pointer for the output stream is initialized at a zero value and read pointer for the input stream is initialized at a value equal to a difference between a length of the output stream and a length of the input stream.

### Claim 17 (depends on 14)

The one or more memory devices of claim 14, wherein the computer process further comprises:
reading the data of the compressed data stream sequentially into a continuous end portion of the allocated memory space, the continuous end portion corresponding with an end portion of the allocated memory space.

### Claim 18 (depends on 14)

The one or more memory devices of claim 14, wherein a last byte in the compressed data stream is stored in a last physical block in the allocated memory space.

### Claim 19 (depends on 14)

The one or more memory devices of claim 14, wherein decompressing the compressed data stream in-place further comprises sequentially writing values of the output stream starting at a first data block in the allocated memory space.

### Claim 20 (depends on 14)

The one or more memory devices of claim 14, wherein the memory space is a continuous sequence of sequential physical blocks.
