@@ -75,6 +75,7 @@ public abstract class AbstractRowsEventDataDeserializer<T extends EventData> imp
7575 private Long invalidDateAndTimeRepresentation ;
7676 private boolean microsecondsPrecision ;
7777 private boolean deserializeCharAndBinaryAsByteArray ;
78+ private boolean deserializeIntegerAsByteArray ;
7879
7980 public AbstractRowsEventDataDeserializer (Map <Long , TableMapEventData > tableMapEventByTableId ) {
8081 this .tableMapEventByTableId = tableMapEventByTableId ;
@@ -97,6 +98,10 @@ void setDeserializeCharAndBinaryAsByteArray(boolean value) {
9798 this .deserializeCharAndBinaryAsByteArray = value ;
9899 }
99100
101+ void setDeserializeIntegerAsByteArray (boolean deserializeIntegerAsByteArray ) {
102+ this .deserializeIntegerAsByteArray = deserializeIntegerAsByteArray ;
103+ }
104+
100105 protected Serializable [] deserializeRow (long tableId , BitSet includedColumns , ByteArrayInputStream inputStream )
101106 throws IOException {
102107 TableMapEventData tableMapEvent = tableMapEventByTableId .get (tableId );
@@ -203,22 +208,37 @@ protected Serializable deserializeBit(int meta, ByteArrayInputStream inputStream
203208 }
204209
205210 protected Serializable deserializeTiny (ByteArrayInputStream inputStream ) throws IOException {
211+ if (deserializeIntegerAsByteArray ) {
212+ return inputStream .read (1 );
213+ }
206214 return (int ) ((byte ) inputStream .readInteger (1 ));
207215 }
208216
209217 protected Serializable deserializeShort (ByteArrayInputStream inputStream ) throws IOException {
218+ if (deserializeIntegerAsByteArray ) {
219+ return inputStream .read (2 );
220+ }
210221 return (int ) ((short ) inputStream .readInteger (2 ));
211222 }
212223
213224 protected Serializable deserializeInt24 (ByteArrayInputStream inputStream ) throws IOException {
225+ if (deserializeIntegerAsByteArray ) {
226+ return inputStream .read (3 );
227+ }
214228 return (inputStream .readInteger (3 ) << 8 ) >> 8 ;
215229 }
216230
217231 protected Serializable deserializeLong (ByteArrayInputStream inputStream ) throws IOException {
232+ if (deserializeIntegerAsByteArray ) {
233+ return inputStream .read (4 );
234+ }
218235 return inputStream .readInteger (4 );
219236 }
220237
221238 protected Serializable deserializeLongLong (ByteArrayInputStream inputStream ) throws IOException {
239+ if (deserializeIntegerAsByteArray ) {
240+ return inputStream .read (8 );
241+ }
222242 return inputStream .readLong (8 );
223243 }
224244
0 commit comments