MemoryStream

MemoryStream

Overview

MemoryStream is a class in Aspose.3D FOSS for Java. Inherits from: Stream, AutoCloseable.

Memory stream for reading and writing data in memory.

This class provides 23 methods for working with MemoryStream objects in Java programs. Available methods include: MemoryStream, Stream, close, copyTo, flush, getBuffer, getInputStream, getLength, getOutputStream, getSize, read, readByte, and 6 additional methods. All public members are accessible to any Java application after installing the Aspose.3D FOSS for Java package. Properties: buffer, inputStream, length, outputStream, size.

Properties

NameTypeAccessDescription
sizeintReadGets the size of the data in the stream.
bufferbyte[]ReadGets the buffer.
lengthlongReadGets the length of the data in the stream.
outputStreamOutputStreamReadGets the output stream.
inputStreamjava.io.InputStreamReadGets the input stream.

Methods

SignatureDescription
MemoryStream()Creates a new memory stream with default capacity.
MemoryStream(capacity: int)Creates a new memory stream with specified capacity.
MemoryStream(data: byte[])Creates a new memory stream from existing data.
getSize()intGets the size of the data in the stream.
getBuffer()byte[]Gets the buffer.
setCapacity(cap: int)Sets the capacity of the stream.
getLength()longGets the length of the data in the stream.
setLength(len: long)Sets the length of the stream.
flush()Flushes the stream (no-op for memory stream).
readByte()intReads a byte from the stream.
read(buf: byte[])intReads bytes from the stream.
read(buf: byte[], start: int, len: int)intReads bytes from the stream.
write(buf: byte[])Writes bytes to the stream.
write(buf: byte[], start: int, len: int)Writes bytes to the stream.
writeByte(b: int)Writes a byte to the stream.
seek(offset: long, seek: int)longSeeks to a position in the stream.
toArray()byte[]Converts the stream to an array.
close()Closes the stream.
copyTo(stream: Stream)Copies the stream content to another stream.
copyTo(stream: OutputStream)Copies the stream content to an output stream.
Stream(in: InputStream)File stream for reading and writing files.
getOutputStream()OutputStreamReturns the output stream.
getInputStream()java.io.InputStreamCreates a new file stream.

See Also

 English