Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.msgpack.core;

/**
* Header of extended type
*/
public class ExtendedTypeHeader {
private final int type;
private final int length;
ExtendedTypeHeader(int type, int length) {
this.type = type;
this.length = length;
}

public int getType() {
return type;
}

public int getLength() {
return length;
}
}
20 changes: 0 additions & 20 deletions msgpack-core/src/main/java/org/msgpack/core/MessagePack.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,26 +93,6 @@ public static final boolean isFixedRaw(byte b) {
}


/**
* Header of extended type
*/
public static class ExtendedTypeHeader {
private final int type;
private final int length;
ExtendedTypeHeader(int type, int length) {
this.type = type;
this.length = length;
}

public int getType() {
return type;
}

public int getLength() {
return length;
}
}

/**
* Create a new MessagePacker that writes the message packed data to a file
* @param outputFile
Expand Down
18 changes: 9 additions & 9 deletions msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,33 +741,33 @@ public int unpackMapHeader() throws IOException {
throw unexpected("Map", b);
}

public MessagePack.ExtendedTypeHeader unpackExtendedTypeHeader() throws IOException {
public ExtendedTypeHeader unpackExtendedTypeHeader() throws IOException {
byte b = consume();
switch(b) {
case Code.FIXEXT1:
return new MessagePack.ExtendedTypeHeader(readByte(), 1);
return new ExtendedTypeHeader(readByte(), 1);
case Code.FIXEXT2:
return new MessagePack.ExtendedTypeHeader(readByte(), 2);
return new ExtendedTypeHeader(readByte(), 2);
case Code.FIXEXT4:
return new MessagePack.ExtendedTypeHeader(readByte(), 4);
return new ExtendedTypeHeader(readByte(), 4);
case Code.FIXEXT8:
return new MessagePack.ExtendedTypeHeader(readByte(), 8);
return new ExtendedTypeHeader(readByte(), 8);
case Code.FIXEXT16:
return new MessagePack.ExtendedTypeHeader(readByte(), 16);
return new ExtendedTypeHeader(readByte(), 16);
case Code.EXT8: {
int len = readNextLength8();
int t = readByte();
return new MessagePack.ExtendedTypeHeader(len, t);
return new ExtendedTypeHeader(len, t);
}
case Code.EXT16: {
int len = readNextLength16();
int t = readByte();
return new MessagePack.ExtendedTypeHeader(len, t);
return new ExtendedTypeHeader(len, t);
}
case Code.EXT32: {
int len = readNextLength32();
int t = readByte();
return new MessagePack.ExtendedTypeHeader(len, t);
return new ExtendedTypeHeader(len, t);
}
}

Expand Down