java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.i2cp.AbuseReason
- All Implemented Interfaces:
Serializable, DataStructure
Defines the structure for why abuse was reported either by the client to the router or by the router to the client.
- See Also:
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionbooleanCompares this abuse reason with another object for equality.Abuse reason text.inthashCode()Hash code derived from the reason string.voidreadBytes(InputStream in) Reads the abuse reason from a stream.voidNew abuse reason text.toString()Returns a string representation of this abuse reason.voidwriteBytes(OutputStream out) Writes the abuse reason to a stream.Methods inherited from class DataStructureImpl
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArrayModifier and TypeMethodDescriptionCalculate the SHA256 value of this object (useful for a few scenarios).voidfromBase64(String data) Load the structure from the provided base64 string.voidfromByteArray(byte[] data) Loads structure from the data providedprotected intread(InputStream in, byte[] target) Repeated reads until buffer is full or IOException is thrown.toBase64()Render the structure into modified base 64 notation.byte[]Convert the structure to a byte array.
Field Details
_reason
Text description of the abuse reason.
Constructor Details
AbuseReason
public AbuseReason()Create a new abuse reason.
Method Details
getReason
setReason
readBytes
Reads the abuse reason from a stream.- Parameters:
in- stream to read from- Throws:
DataFormatException- if the data is improperly formattedIOException- if there was a problem reading the stream
writeBytes
Writes the abuse reason to a stream.- Parameters:
out- stream to write to- Throws:
DataFormatException- if the data was incomplete or not yet ready to be writtenIOException- if there was a problem writing to the stream
equals
hashCode
toString