final void createCommandData() { buildDss(true, false, false, DssConstants.GDSFMT_OBJDSS, correlationID_, false); }
Request(NetAgent netAgent, int minSize, CcsidManager ccsidManager) { netAgent_ = netAgent; bytes_ = new byte[minSize]; ccsidManager_ = ccsidManager; clearBuffer(); }
protected void flush(java.io.OutputStream socketOutputStream) throws java.io.IOException { if (doesRequestContainData()) { finalizeDssLength(); sendBytes(socketOutputStream); } }
protected final void markLengthBytes(int codePoint) { ensureLength(offset_ + 4); // save the location of length bytes in the mark stack. mark(); // skip the length bytes and insert the codepoint offset_ += 2; bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); }
final void writeLDBytes(byte[] bytes) { ensureLength(offset_ + bytes.length + 2); writeLDBytesX(bytes.length, bytes); }
flushExistingDSS(); ensureLength( DssConstants.MAX_DSS_LEN ); buildDss(true, chained, chainedWithSameCorrelator, buildLengthAndCodePointForLob(codePoint, writeNullByte); if( ! peekStream( ( BufferedInputStream ) in ) ) break; flushScalarStreamSegment();
final void padBytes(byte padByte, int length) { ensureLength(offset_ + length); for (int i = 0; i < length; i++) { bytes_[offset_++] = padByte; } }
if (writeNullByte) { extendedLengthByteCount = calculateExtendedLengthByteCount((long) leftToRead + 4 + 1); nullIndicatorSize = 1; } else { extendedLengthByteCount = calculateExtendedLengthByteCount(leftToRead + 4); try { if (simpleDssFinalize) { finalizeDssLength(); } else { finalizePreviousChainedDss(true); sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException e) { netAgent_.throwCommunicationsFailure(e); buildDss(true, chained, chainedWithSameCorrelator, buildDss(true, chained, chainedWithSameCorrelator,
int corrId, boolean simpleFinalizeBuildingNextDss) { if (doesRequestContainData()) { if (simpleDssFinalize) { finalizeDssLength(); } else { finalizePreviousChainedDss(dssHasSameCorrelator); ensureLength(offset_ + 6);
int parameterIndex) throws DisconnectException, SqlException { int leftToRead = length; int extendedLengthByteCount = prepScalarStream(chained, chainedWithSameCorrelator, writeNullByte, buildLengthAndCodePointForLob(codePoint, leftToRead, writeNullByte, totalBytesRead += bytesRead; } catch (java.io.IOException e) { padScalarStreamForError(leftToRead, bytesToRead); padScalarStreamForError(leftToRead, bytesToRead); bytesToRead = flushScalarStreamSegment(leftToRead, bytesToRead); } while (leftToRead > 0);
int extendedLengthByteCount = prepScalarStream(chained, chainedWithSameCorrelator, writeNullByte, lengthAndCodepoint = buildLengthAndCodePointForEncryptedLob(codePoint, leftToRead, writeNullByte, totalBytesRead += bytesRead; } catch (java.io.IOException e) { padScalarStreamForError(leftToRead, bytesToRead); sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe); sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe);
protected final void flushExistingDSS() throws DisconnectException { try { if (simpleDssFinalize) { finalizeDssLength(); } else { finalizePreviousChainedDss(true); } sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException e) { netAgent_.throwCommunicationsFailure(e); } }
protected final void updateLengthBytes() throws SqlException { int lengthLocation = popMark(); int length = offset_ - lengthLocation; int extendedLengthByteCount = calculateExtendedLengthByteCount(length); if (extendedLengthByteCount != 0) { ensureLength(offset_ + extendedLengthByteCount);
protected void sendBytes(java.io.OutputStream socketOutputStream) throws java.io.IOException { try { socketOutputStream.write(bytes_, 0, offset_); socketOutputStream.flush(); } finally { if (netAgent_.logWriter_ != null && passwordIncluded_) { // if password is in the buffer, need to mask it out. maskOutPassword(); passwordIncluded_ = false; } if (netAgent_.loggingEnabled()) { ((NetLogWriter) netAgent_.logWriter_).traceProtocolFlow(bytes_, 0, offset_, NetLogWriter.TYPE_TRACE_SEND, "Request", "flush", 1); // tracepoint } clearBuffer(); } }
protected void sendRequest() throws DisconnectException { try { request_.flush(rawSocketOutputStream_); } catch (java.io.IOException e) { throwCommunicationsFailure(e); } }
protected final void finalizePreviousChainedDss(boolean dssHasSameCorrelator) { finalizeDssLength(); bytes_[dssLengthLocation_ + 3] |= 0x40; if (dssHasSameCorrelator) // for blobs { bytes_[dssLengthLocation_ + 3] |= 0x10; } }
flushExistingDSS(); ensureLength( DssConstants.MAX_DSS_LEN ); buildDss(true, chained, chainedWithSameCorrelator, buildLengthAndCodePointForLob(codePoint, writeNullByte); if( ! peekStream( ( BufferedInputStream ) in ) ) break; flushScalarStreamSegment();
protected final void writeScalar1Byte(int codePoint, int value) { ensureLength(offset_ + 5); bytes_[offset_++] = 0x00; bytes_[offset_++] = 0x05; bytes_[offset_++] = (byte) ((codePoint >>> 8) & 0xff); bytes_[offset_++] = (byte) (codePoint & 0xff); bytes_[offset_++] = (byte) (value & 0xff); }
if (writeNullByte) { extendedLengthByteCount = calculateExtendedLengthByteCount((long) leftToRead + 4 + 1); nullIndicatorSize = 1; } else { extendedLengthByteCount = calculateExtendedLengthByteCount(leftToRead + 4); try { if (simpleDssFinalize) { finalizeDssLength(); } else { finalizePreviousChainedDss(true); sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException e) { netAgent_.throwCommunicationsFailure(e); buildDss(true, chained, chainedWithSameCorrelator, buildDss(true, chained, chainedWithSameCorrelator,
int corrId, boolean simpleFinalizeBuildingNextDss) { if (doesRequestContainData()) { if (simpleDssFinalize) { finalizeDssLength(); } else { finalizePreviousChainedDss(dssHasSameCorrelator); ensureLength(offset_ + 6);