[jboss-cvs] JBoss Messaging SVN: r4831 - in branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting: impl and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 18 11:34:13 EDT 2008


Author: ataylor
Date: 2008-08-18 11:34:13 -0400 (Mon, 18 Aug 2008)
New Revision: 4831

Modified:
   branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/Encoder.java
   branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/EncoderImpl.java
   branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/ChannelBufferWrapper.java
   branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/MessagingFrameDecoder.java
Log:
netty integration

Modified: branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/Encoder.java
===================================================================
--- branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/Encoder.java	2008-08-18 14:59:59 UTC (rev 4830)
+++ branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/Encoder.java	2008-08-18 15:34:13 UTC (rev 4831)
@@ -69,7 +69,7 @@
 
    boolean getBoolean();
 
-   void putBuffer(MessagingBuffer buffern);
+   void putBuffer(MessagingBuffer buffer);
 
    void transferRemainingBuffer(Encoder buffer, int len);
 

Modified: branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/EncoderImpl.java
===================================================================
--- branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/EncoderImpl.java	2008-08-18 14:59:59 UTC (rev 4830)
+++ branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/EncoderImpl.java	2008-08-18 15:34:13 UTC (rev 4831)
@@ -127,7 +127,7 @@
 
    public void putBytes(byte[] bytes, int i, int i1)
    {
-      if(getCurrentBuffer().remaining() >= (i1 - i))
+      if(getCurrentBuffer().capacity() - getCurrentBuffer().position() >= (i1 - i))
       {
          getCurrentBuffer().putBytes(bytes, i, i1);
          pos += (i1 - i);
@@ -474,7 +474,7 @@
 
    private void checkWriteSpace(int size)
    {
-      if(getCurrentBuffer().remaining() < size)
+      if(getCurrentBuffer().capacity() < size)
       {
          setNextFragment();
       }

Modified: branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/ChannelBufferWrapper.java
===================================================================
--- branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/ChannelBufferWrapper.java	2008-08-18 14:59:59 UTC (rev 4830)
+++ branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/ChannelBufferWrapper.java	2008-08-18 15:34:13 UTC (rev 4831)
@@ -463,17 +463,25 @@
 
    public void putBoolean(int pos, boolean b)
    {
-      
+      if (b)
+      {
+         buffer.setByte(pos, TRUE);
+      } else
+      {
+         buffer.setByte(pos, FALSE);
+      }
    }
 
-   public void putBuffer(MessagingBuffer buffern)
+  public void putBuffer(MessagingBuffer buffer)
    {
-      //To change body of implemented methods use File | Settings | File Templates.
+      buffer.putBytes(buffer.array());
    }
 
    public void transferRemainingBuffer(Encoder buffer, int len)
    {
-      //To change body of implemented methods use File | Settings | File Templates.
+      byte[] bytes = new byte[len];
+      this.buffer.readBytes(bytes);
+      buffer.putBytes(bytes);
    }
 
    public Object getUnderlyingBuffer()

Modified: branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/MessagingFrameDecoder.java
===================================================================
--- branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/MessagingFrameDecoder.java	2008-08-18 14:59:59 UTC (rev 4830)
+++ branches/Branch_Message_Chunking_new/src/main/org/jboss/messaging/core/remoting/impl/netty/MessagingFrameDecoder.java	2008-08-18 15:34:13 UTC (rev 4831)
@@ -63,7 +63,7 @@
          return null;
       }
 
-      in.readerIndex(start + SIZE_INT);
-      return in.readBytes(length);
+      in.readerIndex(start);
+      return in.readBytes(length + SIZE_INT);
    }
 }




More information about the jboss-cvs-commits mailing list