[jboss-cvs] JBoss Messaging SVN: r4124 - in trunk/src/main/org/jboss/messaging/core/remoting/impl: mina and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 28 10:17:51 EDT 2008


Author: jmesnil
Date: 2008-04-28 10:17:51 -0400 (Mon, 28 Apr 2008)
New Revision: 4124

Modified:
   trunk/src/main/org/jboss/messaging/core/remoting/impl/codec/RemotingBuffer.java
   trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/BufferWrapper.java
Log:
removed getString() and putString() methods from BufferWrapper interface

Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/codec/RemotingBuffer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/codec/RemotingBuffer.java	2008-04-28 12:09:50 UTC (rev 4123)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/codec/RemotingBuffer.java	2008-04-28 14:17:51 UTC (rev 4124)
@@ -46,10 +46,6 @@
 
    String getNullableString();
    
-   void putString(String nullableString);
-
-   String getString();
-   
    void rewind();
 
    byte[] array();

Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/BufferWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/BufferWrapper.java	2008-04-28 12:09:50 UTC (rev 4123)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/BufferWrapper.java	2008-04-28 14:17:51 UTC (rev 4124)
@@ -163,23 +163,41 @@
       }
    }
    
-   public void putString(final String string)
+   public void rewind()
    {
-   	int len = string.length();
+   	buffer.rewind();
+   }
+
+   public void flip()
+   {
+      buffer.flip();
+   }
+   
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   private void putString(final String string)
+   {
+      assert string != null;
+      
+      int len = string.length();
       buffer.putInt(len);
       for (int i = 0; i < len; i++)
       {   
-      	buffer.putChar(string.charAt(i));
+         buffer.putChar(string.charAt(i));
       }
    }
 
-   public String getString()
+   private String getString()
    {
-   	int len = buffer.getInt();
+      int len = buffer.getInt();
       char[] chars = new char[len];
       for (int i = 0; i < len; i++)
       {
-      	chars[i] = buffer.getChar();
+         chars[i] = buffer.getChar();
       }
                      
       String string =  new String(chars);
@@ -187,21 +205,5 @@
       return string;
    }
    
-   public void rewind()
-   {
-   	buffer.rewind();
-   }
-
-   public void flip()
-   {
-      buffer.flip();
-   }
-   
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
    // Inner classes -------------------------------------------------
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list