public class DefaultByteSourceCreator extends Object implements ByteSourceCreator
| Constructor and Description |
|---|
DefaultByteSourceCreator() |
| Modifier and Type | Method and Description |
|---|---|
ByteSource |
bytes(Object source)
Returns a
ByteSource instance representing the specified byte source argument. |
boolean |
isCompatible(Object source)
Returns
true if the specified object is a recognized data type that can be easily converted to
bytes by instances of this class, false otherwise. |
public boolean isCompatible(Object source)
true if the specified object is a recognized data type that can be easily converted to
bytes by instances of this class, false otherwise.
This implementation returns true IF the specified object is an instance of one of the following
types:
byte[]char[]ByteSourceStringFileInputStream
isCompatible in interface ByteSourceCreatorsource - the object to test to see if it can be easily converted to bytes by instances of this class.true if the specified object can be easily converted to bytes by instances of this class,
false otherwise.public ByteSource bytes(Object source)
ByteSourceCreatorByteSource instance representing the specified byte source argument. If the argument
cannot be easily converted to bytes (as is indicated by the ByteSourceCreator.isCompatible(Object) JavaDoc),
this method will throw an IllegalArgumentException.bytes in interface ByteSourceCreatorsource - the byte-backed instance that should be represented as a ByteSource instance.ByteSource instance representing the specified byte source argument.Copyright © 2014–2018. All rights reserved.