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

# FileStream

## Overview

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

File stream for reading and writing files.

This class provides 16 methods for working with FileStream objects in Java programs.
Available methods include: `FileStream`, `Stream`, `close`, `flush`, `getInputStream`, `getLength`, `getOutputStream`, `read`, `readByte`, `seek`, `setLength`, `write`, and 1 additional methods.
All public members are accessible to any Java application after installing the Aspose.3D FOSS for Java package.
Properties: `APPEND`, `CREATE`, `OPEN`, `READ`, `READ_WRITE`, `WRITE`, and 3 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `length` | `long` | Read | Gets the length of the file. |
| `CREATE` | `int` | Read | Gets the create. |
| `OPEN` | `int` | Read | Gets the open. |
| `APPEND` | `int` | Read | Gets the append. |
| `READ` | `int` | Read | Gets the read. |
| `WRITE` | `int` | Read | Gets the write. |
| `READ_WRITE` | `int` | Read | Gets the read write. |
| `outputStream` | `OutputStream` | Read | Gets the output stream. |
| `inputStream` | `java.io.InputStream` | Read | Gets the input stream. |

## Methods

| Signature | Description |
|-----------|-------------|
| `FileStream(fileName: String, fileMode: int, fileAccess: int)` | Creates a new file stream. |
| `FileStream(fileName: String, fileMode: int)` | Creates a new file stream. |
| `getLength()` → `long` | Gets the length of the file. |
| `setLength(len: long)` | Sets the length of the file. |
| `readByte()` → `int` | Reads a byte from the file. |
| `read(buf: byte[])` → `int` | Reads bytes from the file. |
| `read(buf: byte[], start: int, len: int)` → `int` | Reads bytes from the file. |
| `write(buf: byte[])` | Writes bytes to the file. |
| `write(buf: byte[], start: int, len: int)` | Writes bytes to the file. |
| `writeByte(b: int)` | Writes a byte to the file. |
| `seek(offset: long, seek: int)` → `long` | Seeks to a position in the file. |
| `close()` | Closes the file stream. |
| `flush()` | Flushes the file stream. |
| `Stream(in: InputStream)` | File stream for reading and writing files. |
| `getOutputStream()` → `OutputStream` | Returns the output stream. |
| `getInputStream()` → `java.io.InputStream` | Creates a new file stream. |

## See Also

- [Aspose.3D — Enterprise API Reference](https://reference.aspose.com/3d/)