---
Product: Aspose.3D
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/3d/java/stream
---

# Stream

## Overview

`Stream` is a class in Aspose.3D FOSS for Java.
Inherits from: `java.io.Closeable`.

Created by lexchou on 12/14/2016.

This class provides 16 methods for working with Stream objects in Java programs.
Available methods include: `close`, `copyTo`, `flush`, `getInputStream`, `getLength`, `getOutputStream`, `read`, `readByte`, `seek`, `setLength`, `wrap`, `write`, and 1 additional methods.
All public members are accessible to any Java application after installing the Aspose.3D FOSS for Java package.
Properties: `SEEK_CURRENT`, `SEEK_END`, `SEEK_SET`, `inputStream`, `length`, `outputStream`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `length` | `long` | Read/Write | Gets or sets the length. |
| `inputStream` | `java.io.InputStream` | Read | Gets the input stream. |
| `outputStream` | `java.io.OutputStream` | Read | Gets the output stream. |
| `SEEK_SET` | `int` | Read | Gets the seek set. |
| `SEEK_CURRENT` | `int` | Read | Gets the seek current. |
| `SEEK_END` | `int` | Read | Gets the seek end. |

## Methods

| Signature | Description |
|-----------|-------------|
| `readByte()` → `int` | Calls readByte on this Stream instance. |
| `read(buf: byte[])` → `int` | Calls read(buf) on this Stream instance. |
| `read(buf: byte[], start: int, len: int)` → `int` | Calls read(buf, start, len) on this Stream instance. |
| `write(buf: byte[])` | Calls write(buf) on this Stream instance. |
| `write(buf: byte[], start: int, len: int)` | Calls write(buf, start, len) on this Stream instance. |
| `writeByte(b: int)` | Calls writeByte(b) on this Stream instance. |
| `seek(offset: long, seek: int)` → `long` | Calls seek(offset, seek) on this Stream instance. |
| `copyTo(output: Stream)` | Calls copyTo(output) on this Stream instance. |
| `close()` | Calls close on this Stream instance. |
| `flush()` | Flushes any buffered data to the underlying stream |
| `getLength()` → `long` | Returns the length. |
| `setLength(len: long)` | Sets the length value. |
| `getInputStream()` → `java.io.InputStream` | Returns the input stream. |
| `getOutputStream()` → `java.io.OutputStream` | Returns the output stream. |
| `wrap(stream: OutputStream)` → `Stream` | Wrap an OutputStream as Stream, the stream must be closed to flush data to output stream. |
| `wrap(stream: InputStream)` → `Stream` | Wrap an InputStream as Stream. |

## See Also
- [Aspose.3D for Java — Enterprise API Reference](https://reference.aspose.com/3d/java/com.aspose.threed/stream/)