Package org.drools.core.io.impl
Class ByteArrayResource
- java.lang.Object
-
- org.drools.core.io.impl.BaseResource
-
- org.drools.core.io.impl.ByteArrayResource
-
- All Implemented Interfaces:
Externalizable
,Serializable
,InternalResource
,org.kie.api.io.Resource
public class ByteArrayResource extends BaseResource implements InternalResource, Externalizable
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.drools.core.io.impl.BaseResource
bytes
-
-
Constructor Summary
Constructors Constructor Description ByteArrayResource()
ByteArrayResource(byte[] bytes)
ByteArrayResource(byte[] bytes, String encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
byte[]
getBytes()
String
getEncoding()
InputStream
getInputStream()
Reader
getReader()
URL
getURL()
int
hashCode()
boolean
hasURL()
boolean
isDirectory()
Collection<org.kie.api.io.Resource>
listResources()
void
readExternal(ObjectInput in)
String
toString()
void
writeExternal(ObjectOutput out)
-
Methods inherited from class org.drools.core.io.impl.BaseResource
addCategory, getCategories, getConfiguration, getDescription, getResourceType, getSourcePath, getTargetPath, setCategories, setConfiguration, setDescription, setResourceType, setSourcePath, setTargetPath
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.io.internal.InternalResource
addCategory, getCategories, getConfiguration, getDescription, getResourceType, setCategories, setConfiguration, setDescription, setResourceType
-
-
-
-
Constructor Detail
-
ByteArrayResource
public ByteArrayResource()
-
ByteArrayResource
public ByteArrayResource(byte[] bytes)
-
ByteArrayResource
public ByteArrayResource(byte[] bytes, String encoding)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classBaseResource
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classBaseResource
- Throws:
IOException
-
getEncoding
public String getEncoding()
- Specified by:
getEncoding
in interfaceInternalResource
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStream
in interfaceorg.kie.api.io.Resource
- Throws:
IOException
-
getReader
public Reader getReader() throws IOException
- Specified by:
getReader
in interfaceorg.kie.api.io.Resource
- Throws:
IOException
-
getBytes
public byte[] getBytes()
- Specified by:
getBytes
in interfaceInternalResource
- Overrides:
getBytes
in classBaseResource
-
hasURL
public boolean hasURL()
- Specified by:
hasURL
in interfaceInternalResource
-
getURL
public URL getURL() throws IOException
- Specified by:
getURL
in interfaceInternalResource
- Throws:
IOException
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory
in interfaceInternalResource
-
listResources
public Collection<org.kie.api.io.Resource> listResources()
- Specified by:
listResources
in interfaceInternalResource
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classBaseResource
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseResource
-
toString
public String toString()
- Overrides:
toString
in classBaseResource
-
-