Skip to content

Commit d1e3847

Browse files
committed
Cosmetic fixes.
1 parent 6a31d2a commit d1e3847

File tree

2 files changed

+52
-30
lines changed

2 files changed

+52
-30
lines changed

src/main/java/org/jsl/collider/RetainableByteBufferImpl.java

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,58 +80,69 @@ public RetainableByteBuffer rewind()
8080
* NIO ByteBuffer
8181
*/
8282

83-
public byte get( int index )
83+
public byte get(int index)
8484
{
85-
return m_buf.get( index );
85+
return m_buf.get(index);
8686
}
8787

88-
public RetainableByteBuffer put( int index, byte value )
88+
public RetainableByteBuffer put(int index, byte value)
8989
{
9090
m_buf.put( index, value );
9191
return this;
9292
}
9393

94-
public int getInt( int index )
94+
public short getShort(int index)
9595
{
96-
return m_buf.getInt( index );
96+
return m_buf.getShort(index);
9797
}
9898

99-
public RetainableByteBuffer putInt( int index, int value )
99+
public RetainableByteBuffer putShort(int index , short value)
100100
{
101-
m_buf.putInt( index, value );
101+
m_buf.putShort(index, value);
102102
return this;
103103
}
104104

105-
public short getShort( int index )
105+
public int getInt(int index)
106106
{
107-
return m_buf.getShort( index );
107+
return m_buf.getInt(index);
108108
}
109109

110-
public RetainableByteBuffer putShort( int index , short value )
110+
public RetainableByteBuffer putInt(int index, int value)
111111
{
112-
m_buf.putShort( index, value );
112+
m_buf.putInt(index, value);
113113
return this;
114114
}
115115

116-
public float getFloat( int index )
116+
public long getLong(int index)
117117
{
118-
return m_buf.getFloat( index );
118+
return m_buf.getLong(index);
119119
}
120120

121-
public RetainableByteBuffer putFloat( int index, float value )
121+
public RetainableByteBuffer putLong(int index, long value)
122122
{
123-
m_buf.putFloat( index, value );
123+
m_buf.putLong(index, value);
124124
return this;
125125
}
126126

127-
public double getDouble( int index )
127+
public float getFloat(int index)
128128
{
129-
return m_buf.getDouble( index );
129+
return m_buf.getFloat(index);
130130
}
131131

132-
public RetainableByteBuffer putDouble( int index, double value )
132+
public RetainableByteBuffer putFloat(int index, float value)
133133
{
134-
m_buf.putDouble( index, value );
134+
m_buf.putFloat(index, value);
135+
return this;
136+
}
137+
138+
public double getDouble(int index)
139+
{
140+
return m_buf.getDouble(index);
141+
}
142+
143+
public RetainableByteBuffer putDouble(int index, double value)
144+
{
145+
m_buf.putDouble(index, value);
135146
return this;
136147
}
137148
}

src/main/java/org/jsl/collider/RetainableByteBufferPool.java

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -307,29 +307,40 @@ public RetainableByteBuffer put(int index, byte value)
307307
return this;
308308
}
309309

310+
public short getShort(int index)
311+
{
312+
return m_buf.getShort(m_offs + index);
313+
}
314+
315+
public RetainableByteBuffer putShort(int index, short value)
316+
{
317+
m_buf.putShort(m_offs + index, value);
318+
return this;
319+
}
320+
310321
public int getInt(int index)
311322
{
312323
return m_buf.getInt(m_offs + index);
313324
}
314325

315-
public RetainableByteBuffer putInt( int index, int value )
326+
public RetainableByteBuffer putInt(int index, int value)
316327
{
317-
m_buf.putInt( m_offs + index, value );
328+
m_buf.putInt(m_offs + index, value);
318329
return this;
319330
}
320331

321-
public short getShort( int index )
332+
public long getLong(int index)
322333
{
323-
return m_buf.getShort(m_offs + index);
334+
return m_buf.getLong(m_offs + index);
324335
}
325336

326-
public RetainableByteBuffer putShort( int index, short value )
337+
public RetainableByteBuffer putLong(int index, long value)
327338
{
328-
m_buf.putShort( m_offs + index, value );
339+
m_buf.putLong(m_offs + index, value);
329340
return this;
330341
}
331342

332-
public float getFloat( int index )
343+
public float getFloat(int index)
333344
{
334345
return m_buf.getFloat(m_offs + index);
335346
}
@@ -340,14 +351,14 @@ public RetainableByteBuffer putFloat(int index, float value)
340351
return this;
341352
}
342353

343-
public double getDouble( int index )
354+
public double getDouble(int index)
344355
{
345-
return m_buf.getDouble( m_offs + index );
356+
return m_buf.getDouble(m_offs + index);
346357
}
347358

348-
public RetainableByteBuffer putDouble( int index, double value )
359+
public RetainableByteBuffer putDouble(int index, double value)
349360
{
350-
m_buf.putDouble( m_offs + index, value );
361+
m_buf.putDouble(m_offs + index, value);
351362
return this;
352363
}
353364
}

0 commit comments

Comments
 (0)