1 20 21 package org.snmp4j.transport; 22 23 import java.io.*; 24 25 33 public class MessageLength implements Serializable { 34 35 private static final long serialVersionUID = -2722178759367760246L; 36 37 private int payloadLength; 38 private int headerLength; 39 40 47 public MessageLength(int headerLength, int payloadLength) { 48 this.payloadLength = payloadLength; 49 this.headerLength = headerLength; 50 } 51 52 57 public int getPayloadLength() { 58 return payloadLength; 59 } 60 61 66 public int getHeaderLength() { 67 return headerLength; 68 } 69 70 75 public int getMessageLength() { 76 return headerLength + payloadLength; 77 } 78 79 public String toString() { 80 return MessageLength.class.getName()+ 81 "[headerLength="+headerLength+",payloadLength="+payloadLength+"]"; 82 } 83 } 84 | Popular Tags |