org.apache.pdfbox.pdmodel.common

## Class PDObjectStream

- java.lang.Object
- - org.apache.pdfbox.pdmodel.common.PDStream
  - - org.apache.pdfbox.pdmodel.common.PDObjectStream

All Implemented Interfaces:
  COSObjectable

    public class PDObjectStream
    extends PDStream

A PDStream represents a stream in a PDF document. Streams are tied to a single PDF document.

Author:
  Ben Litchfield

### Constructor Summary

Constructors
Constructor and Description
`PDObjectStream(COSStream str)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static PDObjectStream` `createStream(PDDocument document)` This will create a new PDObjectStream object.
`PDObjectStream` `getExtends()` A reference to an object stream, of which the current object stream is considered an extension.
`int` `getFirstByteOffset()` The byte offset (in the decoded stream) of the first compressed object.
`int` `getNumberOfObjects()` Get the number of compressed object.
`String` `getType()` Get the type of this object, should always return "ObjStm".
`void` `setExtends(PDObjectStream stream)` A reference to an object stream, of which the current object stream is considered an extension.
`void` `setFirstByteOffset(int n)` The byte offset (in the decoded stream) of the first compressed object.
`void` `setNumberOfObjects(int n)` Set the number of objects.

### Methods inherited from class org.apache.pdfbox.pdmodel.common.PDStream

`createInputStream, createInputStream, createInputStream, createOutputStream, createOutputStream, getCOSObject, getDecodedStreamLength, getDecodeParms, getFile, getFileDecodeParams, getFileFilters, getFilters, getLength, getMetadata, setDecodedStreamLength, setDecodeParms, setFile, setFileDecodeParams, setFileFilters, setFilters, setMetadata, toByteArray`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PDObjectStream

    public PDObjectStream(COSStream str)

Constructor.

Parameters:
  `str` - The stream parameter.

### Method Detail

#### createStream

    public static PDObjectStream createStream(PDDocument document)

This will create a new PDObjectStream object.

Parameters:
  `document` - The document that the stream will be part of.
Returns:
  A new stream object.

#### getType

    public String getType()

Get the type of this object, should always return "ObjStm".

Returns:
  The type of this object.

#### getNumberOfObjects

    public int getNumberOfObjects()

Get the number of compressed object.

Returns:
  The number of compressed objects.

#### setNumberOfObjects

    public void setNumberOfObjects(int n)

Set the number of objects.

Parameters:
  `n` - The new number of objects.

#### getFirstByteOffset

    public int getFirstByteOffset()

The byte offset (in the decoded stream) of the first compressed object.

Returns:
  The byte offset to the first object.

#### setFirstByteOffset

    public void setFirstByteOffset(int n)

The byte offset (in the decoded stream) of the first compressed object.

Parameters:
  `n` - The byte offset to the first object.

#### getExtends

    public PDObjectStream getExtends()

A reference to an object stream, of which the current object stream is considered an extension.

Returns:
  The object that this stream is an extension.

#### setExtends

    public void setExtends(PDObjectStream stream)

A reference to an object stream, of which the current object stream is considered an extension.

Parameters:
  `stream` - The object stream extension.