Methods Summary |
---|
private void | createBytes(java.io.Serializable ser)
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(ser);
out.flush();
this.objSer = baos.toByteArray();
|
public java.io.InputStream | getContent()
if (this.objSer == null) {
createBytes(this.objRef);
}
return new ByteArrayInputStream(this.objSer);
|
public long | getContentLength()
if (this.objSer == null) {
return -1;
} else {
return this.objSer.length;
}
|
public boolean | isRepeatable()
return true;
|
public boolean | isStreaming()
return this.objSer == null;
|
public void | writeTo(java.io.OutputStream outstream)
if (outstream == null) {
throw new IllegalArgumentException("Output stream may not be null");
}
if (this.objSer == null) {
ObjectOutputStream out = new ObjectOutputStream(outstream);
out.writeObject(this.objRef);
out.flush();
} else {
outstream.write(this.objSer);
outstream.flush();
}
|