org.mmbase.util
Class SerializableInputStream
java.lang.Object
java.io.InputStream
org.mmbase.util.SerializableInputStream
- All Implemented Interfaces:
- Closeable, Serializable
- Direct Known Subclasses:
- Casting.StringSerializableInputStream
public class SerializableInputStream
- extends InputStream
- implements Serializable
Sometimes you need an InputStream to be Serializable. This wraps
another InputStream, or some other representation of a 'binary'.
- Since:
- MMBase-1.9
- Version:
- $Id: SerializableInputStream.java 41244 2010-03-02 17:07:36Z michiel $
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
- To Do:
- IllegalStateException or so, if the inputstreas is used (already).
SerializableInputStream
public SerializableInputStream(InputStream wrapped,
long s)
SerializableInputStream
public SerializableInputStream(File tempFile,
String name)
throws IOException
- Throws:
IOException- Since:
- MMBase-1.9.2
SerializableInputStream
public SerializableInputStream(File tempFile)
throws IOException
- Throws:
IOException- Since:
- MMBase-1.9.2
SerializableInputStream
public SerializableInputStream(byte[] array)
SerializableInputStream
public SerializableInputStream(FileItem fi)
throws IOException
- Throws:
IOException
SerializableInputStream
SerializableInputStream(SerializableInputStream is)
throws IOException
- Throws:
IOException
toByteArray
public static byte[] toByteArray(InputStream stream)
getSize
public long getSize()
getName
public String getName()
getContentType
public String getContentType()
setContentType
public void setContentType(MimeType ct)
- Since:
- MMBase-1.9.3
get
public byte[] get()
throws IOException
- Throws:
IOException
moveTo
public void moveTo(File f)
_writeObject
protected void _writeObject(ObjectOutputStream out)
throws IOException
- Throws:
IOException
_readObject
protected void _readObject(ObjectInputStream oin)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
finalize
public void finalize()
- Overrides:
finalize in class Object
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException
mark
public void mark(int readlimit)
- Overrides:
mark in class InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported in class InputStream
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class InputStream
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset in class InputStream
- Throws:
IOException
toString
public String toString()
- Overrides:
toString in class Object
inputStreamEquals
protected static boolean inputStreamEquals(SerializableInputStream in1,
SerializableInputStream in2)
throws IOException
- Throws:
IOException
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
getFile
File getFile()
getFileName
public String getFileName()
- Since:
- MMBase-1.9.2
MMBase 2.0-SNAPSHOT - null