aspose.pdf
Class MemStream

java.lang.Object
  extended by aspose.pdf.BasicStream
      extended by aspose.pdf.MemStream

public class MemStream
extends BasicStream

Represents Memory stream extends from BasicStream.


Field Summary
 
Fields inherited from class aspose.pdf.BasicStream
canRead, canSeek, canWrite, length, seek
 
Constructor Summary
MemStream()
          Constructs a MemStream instance.
MemStream(BasicStream fs)
          Constructs a MemStream instance from a BinaryFileStream object.
MemStream(byte[] data)
          Constructs a MemStream instance from a byte array.
MemStream(byte[] data, boolean canwrite)
          Constructs a MemStream instance from a byte array.
MemStream(byte[] data, int orig, int count)
          Constructs a MemStream instance from a byte array.
MemStream(byte[] data, int orig, int count, boolean canwrite)
          Constructs a MemStream instance from a byte array.
MemStream(java.io.InputStream is)
           
MemStream(int capacity)
          Constructs a MemStream instance.
MemStream(MemStream memStream, java.lang.String charsetName)
          Constructs a MemStream instance from another MemStream object.
MemStream(java.lang.String fname)
           
 
Method Summary
 void close()
          Closes the stream.
 void flush()
          Flushs the stream.
 int read()
          Reads a int value from the stream.
 int read(byte[] data)
          Reads a byte array from the stream.
 int read(byte[] data, int offset, int count)
          Reads a byte array from the stream.
 int read(int[] data)
          Reads a int array from the stream.
 int read(int[] data, int offset, int count)
          Reads a int array from the stream.
 byte readByte()
          Reads a byte value from the stream.
 void skip(long number)
          Skips several bytes.
 byte[] toArray()
          Converts into a byte array.
 void write()
          Void write.
 void write(byte data)
          Writes a byte value to the stream.
 void write(byte[] data)
          Writes a byte array to the stream.
 void write(byte[] data, int offset, int count)
          Writes a byte array to the stream.
 void write(java.lang.String string)
          Writes a string into the stream.
 
Methods inherited from class aspose.pdf.BasicStream
getCanRead, getCanSeek, getCanWrite, getLength, getSeek, setCanRead, setCanSeek, setCanWrite, setLength, setSeek, setSeek
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemStream

public MemStream()
Constructs a MemStream instance.


MemStream

public MemStream(java.lang.String fname)
          throws java.io.IOException
Throws:
java.io.IOException

MemStream

public MemStream(java.io.InputStream is)
          throws java.io.IOException
Throws:
java.io.IOException

MemStream

public MemStream(BasicStream fs)
          throws java.io.IOException
Constructs a MemStream instance from a BinaryFileStream object.

Parameters:
fs - The BinaryFileStream object.
Throws:
java.io.IOException

MemStream

public MemStream(int capacity)
Constructs a MemStream instance.

Parameters:
capacity - The capacity of the stream.

MemStream

public MemStream(byte[] data)
Constructs a MemStream instance from a byte array.

Parameters:
data - The byte array.

MemStream

public MemStream(byte[] data,
                 int orig,
                 int count)
Constructs a MemStream instance from a byte array.

Parameters:
data - The byte array.
orig - The original position.
count - The count of the byte values.

MemStream

public MemStream(byte[] data,
                 boolean canwrite)
Constructs a MemStream instance from a byte array.

Parameters:
data - The byte array.
canwrite - Whether the stream can write.

MemStream

public MemStream(byte[] data,
                 int orig,
                 int count,
                 boolean canwrite)
Constructs a MemStream instance from a byte array.

Parameters:
data - The byte array.
orig - The original position.
count - The count of the byte values.
canwrite - Whether the stream can write.

MemStream

public MemStream(MemStream memStream,
                 java.lang.String charsetName)
Constructs a MemStream instance from another MemStream object.

Parameters:
memStream - The MemStream object.
charsetName - The name of a supported charset.[java.nio.charset.Charset]
Method Detail

read

public int read()
Reads a int value from the stream.

Overrides:
read in class BasicStream
Returns:
The int value.

readByte

public byte readByte()
Reads a byte value from the stream.

Overrides:
readByte in class BasicStream
Returns:
The byte value.

read

public int read(byte[] data)
Reads a byte array from the stream.

Parameters:
data - The byte array.
Returns:
The count of the value that reads.

read

public int read(int[] data)
Reads a int array from the stream.

Parameters:
data - The int array.
Returns:
The count of the value that reads.

read

public int read(byte[] data,
                int offset,
                int count)
Reads a byte array from the stream.

Overrides:
read in class BasicStream
Parameters:
data - The byte array.
offset - The stream offset.
count - The count of the byte values to be read.
Returns:
The count of the byte values reads.

read

public int read(int[] data,
                int offset,
                int count)
Reads a int array from the stream.

Parameters:
data - The int array.
offset - The stream offset.
count - The count of the int values to be read.
Returns:
The count of the int values reads.

skip

public void skip(long number)
Skips several bytes.

Overrides:
skip in class BasicStream
Parameters:
number - The number of the byte values.

write

public void write()
Void write.

Overrides:
write in class BasicStream

write

public void write(byte data)
Writes a byte value to the stream.

Overrides:
write in class BasicStream
Parameters:
data - The byte value.

write

public void write(byte[] data)
Writes a byte array to the stream.

Overrides:
write in class BasicStream
Parameters:
data - The byte array.

toArray

public byte[] toArray()
Converts into a byte array.

Returns:
The byte array.

write

public void write(byte[] data,
                  int offset,
                  int count)
Writes a byte array to the stream.

Overrides:
write in class BasicStream
Parameters:
data - The byte array.
offset - The arrays's offset.
count - The count of the values to be write.

flush

public void flush()
Flushs the stream.

Overrides:
flush in class BasicStream

close

public void close()
Closes the stream.

Overrides:
close in class BasicStream

write

public void write(java.lang.String string)
Writes a string into the stream.

Parameters:
string - The string to be write.