mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
fixed some test error
This commit is contained in:
1 parent
fc3671ea00
commit
5785f29ec3
12 files changed
+118
-59
No files matched your search
@@ -51,7 +51,7 @@ public class CPacket implements InteractWithField, IEncodingAble {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean fillDataToFields() throws EncoderException{
|
||||
public boolean fillDataToFields() throws EncoderException, BlockException {
|
||||
// 可变区 => 受保护区(无)
|
||||
|
||||
// 填充可变区 => 非受保护区
|
||||
@@ -128,7 +128,7 @@ public class CPacket implements InteractWithField, IEncodingAble {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int wireEncode(Encoder encoder) throws EncoderException {
|
||||
public int wireEncode(Encoder encoder) throws EncoderException, BlockException {
|
||||
// 首先将属性填充到分区当中
|
||||
if(!this.fillDataToFields()){
|
||||
return 0;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class Data implements IEncodingAble,InteractWithField {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean fillDataToFields() throws EncoderException {
|
||||
public boolean fillDataToFields() throws EncoderException, BlockException {
|
||||
/////////////////////////////////////////////////////////////
|
||||
//// 填充可变区
|
||||
// { => 可变区
|
||||
@@ -216,7 +216,7 @@ public class Data implements IEncodingAble,InteractWithField {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int wireEncode(Encoder encoder) throws EncoderException {
|
||||
public int wireEncode(Encoder encoder) throws EncoderException, BlockException {
|
||||
// 首先将各项属性填充到分区当中
|
||||
if(this.fillDataToFields()){
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package packet;
|
||||
|
||||
import encoding.BlockException;
|
||||
import encoding.EncoderException;
|
||||
import encoding.VlIntException;
|
||||
|
||||
@@ -15,7 +16,7 @@ public interface InteractWithField {
|
||||
* 将包的属性填充到网络包的四个分区当中
|
||||
* @return
|
||||
*/
|
||||
boolean fillDataToFields() throws EncoderException;
|
||||
boolean fillDataToFields() throws EncoderException, BlockException;
|
||||
|
||||
/**
|
||||
* 从网络包的四个分区当中提取出特定网络包的相关属性
|
||||
|
||||
@@ -104,7 +104,7 @@ public class Interest implements InteractWithField,IEncodingAble{
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean fillDataToFields() throws EncoderException {
|
||||
public boolean fillDataToFields() throws EncoderException, BlockException {
|
||||
/////////////////////////////////////////////////////////////
|
||||
//// 填充可变区
|
||||
/////////////////////////////////////////////////////////////
|
||||
@@ -292,7 +292,7 @@ public class Interest implements InteractWithField,IEncodingAble{
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int wireEncode(Encoder encoder) throws EncoderException {
|
||||
public int wireEncode(Encoder encoder) throws EncoderException, BlockException {
|
||||
// 首先将各项属性填充到分区当中
|
||||
if(!this.fillDataToFields()){
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user