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 18 methods for working with FileStream objects in Java programs. Available methods include: FileStream, close, copyTo, flush, getInputStream, getLength, getOutputStream, read, readByte, seek, setLength, wrap, and 2 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, SEEK_CURRENT, and 6 more.

Properties

NameTypeAccessDescription
lengthlongRead/WriteGets the length of the file.
inputStreamjava.io.InputStreamReadGets the input stream.
outputStreamjava.io.OutputStreamReadGets the output stream.
CREATEintReadGets the create.
OPENintReadGets the open.
APPENDintReadGets the append.
READintReadGets the read.
WRITEintReadGets the write.
READ_WRITEintReadGets the read write.
SEEK_SETintReadGets the seek set.
SEEK_CURRENTintReadGets the seek current.
SEEK_ENDintReadGets the seek end.

Methods

SignatureDescription
FileStream(fileName: String, fileMode: int, fileAccess: int)Creates a new file stream.
FileStream(fileName: String, fileMode: int)Creates a new file stream.
getLength() → longGets the length of the file.
setLength(len: long)Sets the length of the file.
readByte() → intReads a byte from the file.
read(buf: byte[]) → intReads bytes from the file.
read(buf: byte[], start: int, len: int) → intReads 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) → longSeeks to a position in the file.
close()Closes the file stream.
flush()Flushes the file stream.
getInputStream() → java.io.InputStreamReturns the input stream.
getOutputStream() → java.io.OutputStreamReturns the output stream.
copyTo(stream: Stream)Calls copyTo(stream) on this FileStream instance.
wrap(stream: OutputStream) → StreamWrap an OutputStream as Stream, the stream must be closed to flush data to output stream.
wrap(stream: InputStream) → StreamWrap an InputStream as Stream.

See Also

 English