public class TypedByteArray extends Object implements TypedInput, TypedOutput
| Constructor and Description |
|---|
TypedByteArray(String mimeType,
byte[] bytes)
Constructs a new typed byte array.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
fileName()
Original filename.
|
byte[] |
getBytes() |
int |
hashCode() |
InputStream |
in()
Read bytes as stream.
|
long |
length()
Length in bytes.
|
String |
mimeType()
Returns the mime type.
|
String |
toString() |
void |
writeTo(OutputStream out)
Writes these bytes to the given output stream.
|
public TypedByteArray(String mimeType, byte[] bytes)
application/unknown if absent.NullPointerException - if bytes are nullpublic byte[] getBytes()
public String fileName()
TypedOutputfileName in interface TypedOutputpublic 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(OutputStream out) throws IOException
TypedOutputwriteTo in interface TypedOutputIOExceptionpublic InputStream in() throws IOException
TypedInputin in interface TypedInputIOExceptionCopyright © 2015 Square, Inc.. All Rights Reserved.