public class TypedByteArray extends java.lang.Object implements TypedInput, TypedOutput
| Constructor and Description |
|---|
TypedByteArray(java.lang.String mimeType,
byte[] bytes)
Constructs a new typed byte array.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
fileName()
Original filename.
|
byte[] |
getBytes() |
int |
hashCode() |
java.io.InputStream |
in()
Read bytes as stream.
|
long |
length()
Length in bytes.
|
java.lang.String |
mimeType()
Returns the mime type.
|
void |
writeTo(java.io.OutputStream out)
Writes these bytes to the given output stream.
|
public TypedByteArray(java.lang.String mimeType,
byte[] bytes)
application/unknown if absent.java.lang.NullPointerException - if bytes are nullpublic byte[] getBytes()
public java.lang.String fileName()
TypedOutputfileName in interface TypedOutputpublic java.lang.String mimeType()
TypedInputmimeType in interface TypedInputmimeType in interface TypedOutputpublic long length()
TypedInput-1 if length is unknown.length in interface TypedInputlength in interface TypedOutputpublic void writeTo(java.io.OutputStream out)
throws java.io.IOException
TypedOutputwriteTo in interface TypedOutputjava.io.IOExceptionpublic java.io.InputStream in()
throws java.io.IOException
TypedInputin in interface TypedInputjava.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2014 Square, Inc.. All Rights Reserved.