1515 */ 
1616package  uk .co .real_logic .sbe .codec .java ;
1717
18+ import  uk .co .real_logic .agrona .DirectBuffer ;
19+ import  uk .co .real_logic .agrona .MutableDirectBuffer ;
20+ 
1821import  java .nio .ByteOrder ;
1922
2023public  class  CodecUtil 
2124{
2225 /** 
23-  * Put a character to a {@link DirectBuffer } at the given index. 
26+  * Put a character to a {@link MutableDirectBuffer } at the given index. 
2427 * 
2528 * @param buffer to which the value should be written. 
2629 * @param index from which to begin writing. 
2730 * @param value to be be written. 
2831 */ 
29-  public  static  void  charPut (final  DirectBuffer  buffer , final  int  index , final  byte  value )
32+  public  static  void  charPut (final  MutableDirectBuffer  buffer , final  int  index , final  byte  value )
3033 {
3134 buffer .putByte (index , value );
3235 }
3336
3437 /** 
35-  * Put an array into a {@link DirectBuffer } at the given index. 
38+  * Put an array into a {@link MutableDirectBuffer } at the given index. 
3639 * 
3740 * @param buffer to which the value should be written. 
3841 * @param index from which to begin writing. 
@@ -41,25 +44,25 @@ public static void charPut(final DirectBuffer buffer, final int index, final byt
4144 * @param length of the src buffer to copy. 
4245 */ 
4346 public  static  void  charsPut (
44-  final  DirectBuffer  buffer , final  int  index , final  byte [] src , final  int  offset , final  int  length )
47+  final  MutableDirectBuffer  buffer , final  int  index , final  byte [] src , final  int  offset , final  int  length )
4548 {
4649 buffer .putBytes (index , src , offset , length );
4750 }
4851
4952 /** 
50-  * Put a 8-bit integer to a {@link DirectBuffer } at the given index. 
53+  * Put a 8-bit integer to a {@link MutableDirectBuffer } at the given index. 
5154 * 
5255 * @param buffer to which the value should be written. 
5356 * @param index from which to begin writing. 
5457 * @param value to be be written. 
5558 */ 
56-  public  static  void  int8Put (final  DirectBuffer  buffer , final  int  index , final  byte  value )
59+  public  static  void  int8Put (final  MutableDirectBuffer  buffer , final  int  index , final  byte  value )
5760 {
5861 buffer .putByte (index , value );
5962 }
6063
6164 /** 
62-  * Put an array into a {@link DirectBuffer } at the given index. 
65+  * Put an array into a {@link MutableDirectBuffer } at the given index. 
6366 * 
6467 * @param buffer to which the value should be written. 
6568 * @param index from which to begin writing. 
@@ -68,98 +71,98 @@ public static void int8Put(final DirectBuffer buffer, final int index, final byt
6871 * @param length of the src buffer to copy. 
6972 */ 
7073 public  static  void  int8sPut (
71-  final  DirectBuffer  buffer , final  int  index , final  byte [] src , final  int  offset , final  int  length )
74+  final  MutableDirectBuffer  buffer , final  int  index , final  byte [] src , final  int  offset , final  int  length )
7275 {
7376 buffer .putBytes (index , src , offset , length );
7477 }
7578
7679 /** 
77-  * Put a 16-bit integer to a {@link DirectBuffer } at the given index. 
80+  * Put a 16-bit integer to a {@link MutableDirectBuffer } at the given index. 
7881 * 
7982 * @param buffer to which the value should be written. 
8083 * @param index from which to begin writing. 
8184 * @param value to be be written. 
8285 * @param byteOrder for the buffer encoding 
8386 */ 
84-  public  static  void  int16Put (final  DirectBuffer  buffer , final  int  index , final  short  value , final  ByteOrder  byteOrder )
87+  public  static  void  int16Put (final  MutableDirectBuffer  buffer , final  int  index , final  short  value , final  ByteOrder  byteOrder )
8588 {
8689 buffer .putShort (index , value , byteOrder );
8790 }
8891
8992 /** 
90-  * Put a 32-bit integer to a {@link DirectBuffer } at the given index. 
93+  * Put a 32-bit integer to a {@link MutableDirectBuffer } at the given index. 
9194 * 
9295 * @param buffer to which the value should be written. 
9396 * @param index from which to begin writing. 
9497 * @param value to be be written. 
9598 * @param byteOrder for the buffer encoding 
9699 */ 
97-  public  static  void  int32Put (final  DirectBuffer  buffer , final  int  index , final  int  value , final  ByteOrder  byteOrder )
100+  public  static  void  int32Put (final  MutableDirectBuffer  buffer , final  int  index , final  int  value , final  ByteOrder  byteOrder )
98101 {
99102 buffer .putInt (index , value , byteOrder );
100103 }
101104
102105 /** 
103-  * Put a 64-bit integer to a {@link DirectBuffer } at the given index. 
106+  * Put a 64-bit integer to a {@link MutableDirectBuffer } at the given index. 
104107 * 
105108 * @param buffer to which the value should be written. 
106109 * @param index from which to begin writing. 
107110 * @param value to be be written. 
108111 * @param byteOrder for the buffer encoding 
109112 */ 
110-  public  static  void  int64Put (final  DirectBuffer  buffer , final  int  index , final  long  value , final  ByteOrder  byteOrder )
113+  public  static  void  int64Put (final  MutableDirectBuffer  buffer , final  int  index , final  long  value , final  ByteOrder  byteOrder )
111114 {
112115 buffer .putLong (index , value , byteOrder );
113116 }
114117
115118 /** 
116-  * Put a 8-bit signed integer to a {@link DirectBuffer } at the given index. 
119+  * Put a 8-bit signed integer to a {@link MutableDirectBuffer } at the given index. 
117120 * 
118121 * @param buffer to which the value should be written. 
119122 * @param index from which to begin writing. 
120123 * @param value to be be written. 
121124 * @throws IllegalArgumentException if the number is negative 
122125 */ 
123-  public  static  void  uint8Put (final  DirectBuffer  buffer , final  int  index , final  short  value )
126+  public  static  void  uint8Put (final  MutableDirectBuffer  buffer , final  int  index , final  short  value )
124127 {
125128 buffer .putByte (index , (byte )value );
126129 }
127130
128131 /** 
129-  * Put a 16-bit signed integer to a {@link DirectBuffer } at the given index. 
132+  * Put a 16-bit signed integer to a {@link MutableDirectBuffer } at the given index. 
130133 * 
131134 * @param buffer to which the value should be written. 
132135 * @param index from which to begin writing. 
133136 * @param value to be be written. 
134137 * @param byteOrder for the buffer encoding 
135138 */ 
136-  public  static  void  uint16Put (final  DirectBuffer  buffer , final  int  index , final  int  value , final  ByteOrder  byteOrder )
139+  public  static  void  uint16Put (final  MutableDirectBuffer  buffer , final  int  index , final  int  value , final  ByteOrder  byteOrder )
137140 {
138141 buffer .putShort (index , (short )value , byteOrder );
139142 }
140143
141144 /** 
142-  * Put a 32-bit signed integer to a {@link DirectBuffer } at the given index. 
145+  * Put a 32-bit signed integer to a {@link MutableDirectBuffer } at the given index. 
143146 * 
144147 * @param buffer to which the value should be written. 
145148 * @param index from which to begin writing. 
146149 * @param value to be be written. 
147150 * @param byteOrder for the buffer encoding 
148151 */ 
149-  public  static  void  uint32Put (final  DirectBuffer  buffer , final  int  index , final  long  value , final  ByteOrder  byteOrder )
152+  public  static  void  uint32Put (final  MutableDirectBuffer  buffer , final  int  index , final  long  value , final  ByteOrder  byteOrder )
150153 {
151154 buffer .putInt (index , (int )value , byteOrder );
152155 }
153156
154157 /** 
155-  * Put a 64-bit signed integer to a {@link DirectBuffer } at the given index. 
158+  * Put a 64-bit signed integer to a {@link MutableDirectBuffer } at the given index. 
156159 * 
157160 * @param buffer to which the value should be written. 
158161 * @param index from which to begin writing. 
159162 * @param value to be be written. 
160163 * @param byteOrder for the buffer encoding 
161164 */ 
162-  public  static  void  uint64Put (final  DirectBuffer  buffer , final  int  index , final  long  value , final  ByteOrder  byteOrder )
165+  public  static  void  uint64Put (final  MutableDirectBuffer  buffer , final  int  index , final  long  value , final  ByteOrder  byteOrder )
163166 {
164167 buffer .putLong (index , value , byteOrder );
165168 }
@@ -172,7 +175,7 @@ public static void uint64Put(final DirectBuffer buffer, final int index, final l
172175 * @param value to be be written. 
173176 * @param byteOrder for the buffer encoding 
174177 */ 
175-  public  static  void  floatPut (final  DirectBuffer  buffer , final  int  index , final  float  value , final  ByteOrder  byteOrder )
178+  public  static  void  floatPut (final  MutableDirectBuffer  buffer , final  int  index , final  float  value , final  ByteOrder  byteOrder )
176179 {
177180 buffer .putFloat (index , value , byteOrder );
178181 }
@@ -185,7 +188,7 @@ public static void floatPut(final DirectBuffer buffer, final int index, final fl
185188 * @param value to be be written. 
186189 * @param byteOrder for the buffer encoding 
187190 */ 
188-  public  static  void  doublePut (final  DirectBuffer  buffer , final  int  index , final  double  value , final  ByteOrder  byteOrder )
191+  public  static  void  doublePut (final  MutableDirectBuffer  buffer , final  int  index , final  double  value , final  ByteOrder  byteOrder )
189192 {
190193 buffer .putDouble (index , value , byteOrder );
191194 }
@@ -379,7 +382,7 @@ public static boolean uint8GetChoice(final DirectBuffer buffer, final int index,
379382 * @param bitIndex bit index to set. 
380383 * @param switchOn true sets bit to 1 and false sets it to 0. 
381384 */ 
382-  public  static  void  uint8PutChoice (final  DirectBuffer  buffer , final  int  index , final  int  bitIndex , boolean  switchOn )
385+  public  static  void  uint8PutChoice (final  MutableDirectBuffer  buffer , final  int  index , final  int  bitIndex , boolean  switchOn )
383386 {
384387 byte  bits  = buffer .getByte (index );
385388 bits  = (byte )(switchOn  ? bits  | (1  << bitIndex ) : bits  & ~(1  << bitIndex ));
@@ -411,7 +414,7 @@ public static boolean uint16GetChoice(
411414 * @param byteOrder for the buffer encoding 
412415 */ 
413416 public  static  void  uint16PutChoice (
414-  final  DirectBuffer  buffer , final  int  index , final  int  bitIndex , final  boolean  switchOn , final  ByteOrder  byteOrder )
417+  final  MutableDirectBuffer  buffer , final  int  index , final  int  bitIndex , final  boolean  switchOn , final  ByteOrder  byteOrder )
415418 {
416419 short  bits  = buffer .getShort (index , byteOrder );
417420 bits  = (short )(switchOn  ? bits  | (1  << bitIndex ) : bits  & ~(1  << bitIndex ));
@@ -443,7 +446,7 @@ public static boolean uint32GetChoice(
443446 * @param byteOrder for the buffer encoding 
444447 */ 
445448 public  static  void  uint32PutChoice (
446-  final  DirectBuffer  buffer , final  int  index , final  int  bitIndex , final  boolean  switchOn , final  ByteOrder  byteOrder )
449+  final  MutableDirectBuffer  buffer , final  int  index , final  int  bitIndex , final  boolean  switchOn , final  ByteOrder  byteOrder )
447450 {
448451 int  bits  = buffer .getInt (index , byteOrder );
449452 bits  = switchOn  ? bits  | (1  << bitIndex ) : bits  & ~(1  << bitIndex );
@@ -475,7 +478,7 @@ public static boolean uint64GetChoice(
475478 * @param byteOrder for the buffer encoding 
476479 */ 
477480 public  static  void  uint64PutChoice (
478-  final  DirectBuffer  buffer , final  int  index , final  int  bitIndex , final  boolean  switchOn , final  ByteOrder  byteOrder )
481+  final  MutableDirectBuffer  buffer , final  int  index , final  int  bitIndex , final  boolean  switchOn , final  ByteOrder  byteOrder )
479482 {
480483 long  bits  = buffer .getLong (index , byteOrder );
481484 bits  = switchOn  ? bits  | (1L  << bitIndex ) : bits  & ~(1L  << bitIndex );
0 commit comments