BAEL-3603 Update variable names

This commit is contained in:
Roger Yates 2020-03-17 06:32:39 +10:00
parent 5c83dddb91
commit 38843e814b
1 changed files with 12 additions and 12 deletions

View File

@ -40,14 +40,14 @@ public class NonBlockingClientUnitTest {
// when we write and read using buffers // when we write and read using buffers
socketChannel.write(charset.encode(CharBuffer.wrap("GET " + REQUESTED_RESOURCE + " HTTP/1.0\r\n\r\n"))); socketChannel.write(charset.encode(CharBuffer.wrap("GET " + REQUESTED_RESOURCE + " HTTP/1.0\r\n\r\n")));
ByteBuffer buffer = ByteBuffer.allocate(8); // or allocateDirect if we need direct memory access ByteBuffer byteBuffer = ByteBuffer.allocate(8192); // or allocateDirect if we need direct memory access
CharBuffer charBuffer = CharBuffer.allocate(8192); CharBuffer charBuffer = CharBuffer.allocate(8192);
CharsetDecoder decoder = charset.newDecoder(); CharsetDecoder charsetDecoder = charset.newDecoder();
StringBuilder ourStore = new StringBuilder(); StringBuilder ourStore = new StringBuilder();
while (socketChannel.read(buffer) != -1 || buffer.position() > 0) { while (socketChannel.read(byteBuffer) != -1 || byteBuffer.position() > 0) {
buffer.flip(); byteBuffer.flip();
storeBufferContents(buffer, charBuffer, decoder, ourStore); storeBufferContents(byteBuffer, charBuffer, charsetDecoder, ourStore);
buffer.compact(); byteBuffer.compact();
} }
socketChannel.close(); socketChannel.close();
@ -67,14 +67,14 @@ public class NonBlockingClientUnitTest {
// when we write and read using buffers that are too small for our message // when we write and read using buffers that are too small for our message
socketChannel.write(charset.encode(CharBuffer.wrap("GET " + REQUESTED_RESOURCE + " HTTP/1.0\r\n\r\n"))); socketChannel.write(charset.encode(CharBuffer.wrap("GET " + REQUESTED_RESOURCE + " HTTP/1.0\r\n\r\n")));
ByteBuffer buffer = ByteBuffer.allocate(8); // or allocateDirect if we need direct memory access ByteBuffer byteBuffer = ByteBuffer.allocate(8); // or allocateDirect if we need direct memory access
CharBuffer charBuffer = CharBuffer.allocate(8); CharBuffer charBuffer = CharBuffer.allocate(8);
CharsetDecoder decoder = charset.newDecoder(); CharsetDecoder charsetDecoder = charset.newDecoder();
StringBuilder ourStore = new StringBuilder(); StringBuilder ourStore = new StringBuilder();
while (socketChannel.read(buffer) != -1 || buffer.position() > 0) { while (socketChannel.read(byteBuffer) != -1 || byteBuffer.position() > 0) {
buffer.flip(); byteBuffer.flip();
storeBufferContents(buffer, charBuffer, decoder, ourStore); storeBufferContents(byteBuffer, charBuffer, charsetDecoder, ourStore);
buffer.compact(); byteBuffer.compact();
} }
socketChannel.close(); socketChannel.close();