Package org.drools.util.io
Class ByteArrayResource
- java.lang.Object
-
- org.drools.util.io.BaseResource
-
- org.drools.util.io.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.util.io.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 booleanequals(Object object)byte[]getBytes()StringgetEncoding()InputStreamgetInputStream()ReadergetReader()URLgetURL()inthashCode()booleanhasURL()booleanisDirectory()Collection<org.kie.api.io.Resource>listResources()voidreadExternal(ObjectInput in)StringtoString()voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.drools.util.io.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.util.io.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:
readExternalin interfaceExternalizable- Overrides:
readExternalin classBaseResource- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classBaseResource- Throws:
IOException
-
getEncoding
public String getEncoding()
- Specified by:
getEncodingin interfaceInternalResource
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStreamin interfaceorg.kie.api.io.Resource- Throws:
IOException
-
getReader
public Reader getReader() throws IOException
- Specified by:
getReaderin interfaceorg.kie.api.io.Resource- Throws:
IOException
-
getBytes
public byte[] getBytes()
- Specified by:
getBytesin interfaceInternalResource- Overrides:
getBytesin classBaseResource
-
hasURL
public boolean hasURL()
- Specified by:
hasURLin interfaceInternalResource
-
getURL
public URL getURL() throws IOException
- Specified by:
getURLin interfaceInternalResource- Throws:
IOException
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectoryin interfaceInternalResource
-
listResources
public Collection<org.kie.api.io.Resource> listResources()
- Specified by:
listResourcesin interfaceInternalResource
-
equals
public boolean equals(Object object)
- Overrides:
equalsin classBaseResource
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseResource
-
toString
public String toString()
- Overrides:
toStringin classBaseResource
-
-