You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2012/07/18 12:02:34 UTC

svn commit: r1362837 - in /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda: DDMReader.java DDMWriter.java

Author: kahatlen
Date: Wed Jul 18 10:02:34 2012
New Revision: 1362837

URL: http://svn.apache.org/viewvc?rev=1362837&view=rev
Log:
DERBY-5860: Remove unused methods in DDMReader and DDMWriter

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java?rev=1362837&r1=1362836&r2=1362837&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java Wed Jul 18 10:02:34 2012
@@ -222,11 +222,6 @@ class DDMReader
         ccsidManager = ebcdicCcsidManager;
     }
     
-    // Get the current ccsidManager
-    protected CcsidManager getCurrentCcsidManager() {
-        return ccsidManager;
-    }
-    
 	protected boolean terminateChainOnErr()
 	{
 		return terminateChainOnErr;
@@ -977,14 +972,6 @@ class DDMReader
       }
     }
 
-	
-
-	byte[] getExtData (boolean checkNullability) throws DRDAProtocolException
-	{
-		return  getExtData(ddmScalarLen, checkNullability);
-	}
-
-	
 	/**
 	 * Creates an InputStream which can stream EXTDTA objects.
 	 * The InputStream uses this DDMReader to read data from network. The 
@@ -1353,18 +1340,6 @@ class DDMReader
     }
 
 	/**
-	 * Read boolean value
-	 * @return	value
-	 *
-	 * @exception DRDAProtocolException if a protocol error is detected
-	 */
-	protected boolean readBoolean () throws DRDAProtocolException
-	{
-		ensureBLayerDataInBuffer (1, ADJUST_LENGTHS);
-		return buffer[pos++] != 0;
-	}
-
-	/**
 	 * Read encrypted string
 	 * @param   decryptM  decryption manager
 	 * @param   securityMechanism security mechanism
@@ -1459,18 +1434,6 @@ class DDMReader
 	}
 
 	/**
-	 * Read string value in DDM data with default encoding
-	 * @return value
-	 *
-	 * @exception DRDAProtocolException if a protocol error is detected
-	 */
-	protected String readStringData()
-		throws DRDAProtocolException
-	{
-		return readString((int)ddmScalarLen, NetworkServerControlImpl.DEFAULT_ENCODING);
-	}
-
-	/**
 	 * Read specified length of string value in DDM data with default encoding
 	 * @param length  - length of string to read
 	 * @return value
@@ -1966,16 +1929,6 @@ class DDMReader
 			agent.trace(msg);
 	}
 
-	protected String toDebugString(String indent)
-	{
-		String s = indent + "***** DDMReader toDebugString ******\n";
-		int buflen = 0;
-		if (buffer != null)
-			buflen = buffer.length;
-	   s += indent + "Reader buffer length = " + buffer.length + "\n";
-	   return s;
-	}
-
 	/**
 	 * Return chaining bit for current DSS.
 	 */

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java?rev=1362837&r1=1362836&r2=1362837&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java Wed Jul 18 10:02:34 2012
@@ -675,43 +675,6 @@ class DDMWriter
 		ensureLength (2);
 		buffer.putShort((short) value);
 	}
-
-	/**
-	 * Write length and codepoint
-	 *
-	 * @param 	length - length of object
-	 * @param 	codePoint - code point to write
-	 */
-	protected void startDdm (int length, int codePoint)
-	{
-		ensureLength (4);
-		buffer.putShort((short) length);
-		buffer.putShort((short) codePoint);
-	}
-
-	/**
-	 * Write scalar byte array object includes length, codepoint and value
-	 *
-	 * @param 	codePoint - code point to write
-	 * @param	buf  - value to write after code point
-	 * @param	length - number of bytes to write
-	 */
-	protected void writeScalarBytes (int codePoint, byte[] buf, int length)
-	{
-		if (SanityManager.DEBUG)
-		{
-			if (buf == null && length > 0)
-		    	SanityManager.THROWASSERT("Buf is null");
-			if (length > buf.length)
-		    	SanityManager.THROWASSERT("Not enough bytes in buffer");
-		}
-		ensureLength (length + 4);
-		buffer.putShort((short) length);
-		buffer.putShort((short) codePoint);
-		buffer.put(buf, 0, length);
-	}
-
-
     
     protected void writeScalarStream (boolean chainedWithSameCorrelator,
 									  int codePoint,
@@ -965,23 +928,6 @@ class DDMWriter
 	}
 
 	/**
-	 * Write padded scalar string object value
-	 * the string is converted into the appropriate codeset (EBCDIC)
-	 *
-	 * @param	string - string to be written
-	 * @param 	paddedLength - length to pad string to
-	 */
-	protected void writeScalarPaddedString (String string, int paddedLength)
-	{
-		int stringLength = ccsidManager.getByteLength(string);
-
-		int fillLength = paddedLength -stringLength;
-		ensureLength (paddedLength);
-		ccsidManager.convertFromJavaString(string, buffer);
-		padBytes(ccsidManager.space, fillLength);
-	}
-
-	/**
 	 * Write padded scalar <code>DRDAString</code> object value. The
 	 * string is converted into the appropriate codeset.
 	 *
@@ -1043,29 +989,6 @@ class DDMWriter
 		buffer.put(buf);
 	}
 
-	/**
-	 * Write scalar byte array object includes length, codepoint and value
-	 *
-	 * @param 	codePoint - code point to write
-	 * @param	buf - byte array to be written
-	 * @param	start - starting point
-	 * @param 	length - length to write
-	 */
-	protected void writeScalarBytes (int codePoint, byte[] buf, int start, int length)
-	{
-		if (SanityManager.DEBUG)
-		{
-			if (buf == null && length > start)
-		    	SanityManager.THROWASSERT("Buf is null");
-			if (length - start > buf.length)
-				SanityManager.THROWASSERT("Not enough bytes in buffer");
-		}
-		int numBytes = length - start;
-		ensureLength (numBytes + 4);
-		buffer.putShort((short) (numBytes + 4));
-		buffer.putShort((short) codePoint);
-		buffer.put(buf, start, length);
-	}
 	// The following methods write data in the platform format
 	// The platform format was indicated during connection time as ASC since
 	// JCC doesn't read JVM platform (yet)
@@ -1801,39 +1724,6 @@ class DDMWriter
 	}
 
 
-	/***
-	 * Prepend zeros to numeric string
-	 *
-	 * @param s string
-	 * @param precision - length of padded string
- 	 *
-	 * @return zero padded string
-	 */
-	public static String zeroPadString(String s, int precision)
-	{
-
-		if (s == null)
-			return s;
-
-		int slen = s.length();
-		if (precision == slen)
-			return s;
-		else if (precision > slen)
-		{
-			char[] ca  = new char[precision - slen];
-			Arrays.fill(ca,0,precision - slen,'0');
-			return new String(ca) + s;
-		}
-		else
-		{
-			// Shouldn't happen but just in case 
-			// truncate
-			return s.substring(0,precision);
-		}
-
-	}
-
-    
     private void sendBytes (java.io.OutputStream socketOutputStream) 
 	throws java.io.IOException{
 	
@@ -1870,14 +1760,6 @@ class DDMWriter
     }
   }
 
-	protected String toDebugString(String indent)
-	{
-		String s = indent + "***** DDMWriter toDebugString ******\n";
-		int len = (buffer != null) ? buffer.capacity() : 0;
-		s += indent + "byte buffer length  = " + len + "\n";
-		return s;
-	}
-
 	/**
 	 * Reset any chaining state that needs to be reset
 	 * at time of the send