java.lang.Object
net.i2p.data.i2cp.I2CPMessageImpl
net.i2p.data.i2cp.GetBandwidthLimitsMessage
- All Implemented Interfaces:
I2CPMessage
Request the router tells us the current bw limits.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intI2CP message type number identifying a bandwidth limit query.Constructor Summary
ConstructorsMethod Summary
Public MethodsModifier and TypeMethodDescriptionprotected voiddoReadMessage(InputStream in, int size) Read the message from the stream.protected byte[]Write the message body to the output stream.intgetType()Reports this message's I2CP type number.toString()Returns a string representation of this message.Methods inherited from class I2CPMessageImpl
readBytes, readMessage, readMessage, sessionId, writeBytes, writeMessageModifier and TypeMethodDescriptionvoidreadBytes(InputStream in) Read the message from the stream, wrapping I2CPMessageException inDataFormatException.voidValidate the type and size of the message, and then read the message into the data structures.voidreadMessage(InputStream in, int length, int type) Read the body into the data structures.Return the SessionId for this type of message.voidwriteBytes(OutputStream out) Write the message to the stream, wrapping I2CPMessageException in DataFormatException.voidwriteMessage(OutputStream out) Write out the full message to the stream, including the 4 byte size and 1 byte type header.
Field Details
MESSAGE_TYPE
public static final int MESSAGE_TYPEI2CP message type number identifying a bandwidth limit query.- See Also:
Constructor Details
GetBandwidthLimitsMessage
public GetBandwidthLimitsMessage()No data to initialize for this message type.
Method Details
doReadMessage
Read the message from the stream. No data is read for this message type.- Specified by:
doReadMessagein classI2CPMessageImpl- Parameters:
in- positioned just past the 4 byte size and 1 byte type headersize- how many payload bytes remain to be read- Throws:
I2CPMessageException- if the message format is invalidIOException- if there's an error reading from the stream
doWriteMessage
Write the message body to the output stream.- Specified by:
doWriteMessagein classI2CPMessageImpl- Returns:
- byte array
- Throws:
I2CPMessageException- if the message cannot be writtenIOException- if there's an error writing to the stream
getType
public int getType()Reports this message's I2CP type number.- Returns:
- the I2CP message type ID, always
MESSAGE_TYPE
toString