aspose.pdf
Class MemStream

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

public class MemStream
extends BasicStream

Class represented Memory stream extends from BasicStream.

Since:
Jul 21, 2011

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 inputStream)
          Constructs a MemStream instance from a InputStream object.
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)
          Constructs a MemStream instance from file.
 
Method Summary
 void close()
          Closes the stream.
 void flush()
          Flushes 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.
 byte readByte()
          Reads a byte value from the stream.
 void setSeek(long value)
          Sets the current position.
 void setSeek(long orig, long offset)
          Sets the offset.
 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
 
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
Constructs a MemStream instance from file.

Parameters:
fname - the path for the file
Throws:
java.io.IOException - if I/O error occurred

MemStream

public MemStream(java.io.InputStream inputStream)
          throws java.io.IOException
Constructs a MemStream instance from a InputStream object.

Parameters:
inputStream - the InputStream object
Throws:
java.io.IOException - if I/O error occurred

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 - if I/O error occurred

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(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

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

setSeek

public void setSeek(long value)
Sets the current position.

Overrides:
setSeek in class BasicStream
Parameters:
value - The position.

setSeek

public void setSeek(long orig,
                    long offset)
Sets the offset.

Overrides:
setSeek in class BasicStream
Parameters:
orig - The original value.
offset - The offset.

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()
Flushes 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