You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/03/26 06:34:58 UTC
svn commit: rev 9762 - incubator/directory/snickers/branches/chunking/ber/src/java/org/apache/snickers/ber
Author: akarasulu
Date: Thu Mar 25 21:34:57 2004
New Revision: 9762
Modified:
incubator/directory/snickers/branches/chunking/ber/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java
Log:
changes for buffers and chunking
Modified: incubator/directory/snickers/branches/chunking/ber/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java
==============================================================================
--- incubator/directory/snickers/branches/chunking/ber/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java (original)
+++ incubator/directory/snickers/branches/chunking/ber/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java Thu Mar 25 21:34:57 2004
@@ -46,7 +46,8 @@
private ArrayList children = new ArrayList() ;
/** this node's parent node */
private DefaultMutableTupleNode parent ;
-
+ /** this node's value */
+ private ByteBuffer value ;
/**
* Creates a node without a parent and without a tuple.
@@ -61,9 +62,10 @@
*
* @param tuple the tuple to set for this node
*/
- public DefaultMutableTupleNode( Tuple tuple )
+ public DefaultMutableTupleNode( Tuple tuple, ByteBuffer value )
{
this.tuple = tuple ;
+ this.value = value ;
}
@@ -262,7 +264,7 @@
*/
public void encode( ByteBuffer dest )
{
- dest.put( tuple.toEncodedArray() ) ;
+ dest.put( tuple.toEncodedBuffer( this.value ) ) ;
if ( tuple.isPrimitive() )
{
@@ -306,7 +308,7 @@
buf.append( tuple.getId() ) ;
buf.append( ' ' ).append( tuple.typeClass ) ;
buf.append( '[' ).append( tuple.length ).append( ']' ) ;
- buf.append( '[' ).append( new String( (byte[]) tuple.getValue() ) ) ;
+ buf.append( '[' ).append( new String( tuple.getValue().array() ) ) ;
buf.append( ']' ) ;
return buf.toString() ;
@@ -331,8 +333,10 @@
*/
public void analyze()
{
+ /*
TupleTreeAnalyzer analyzer = new TupleTreeAnalyzer( this ) ;
analyzer.startup() ;
+ */
}
@@ -355,7 +359,7 @@
buf.append( levelTab ).append( tuple.getId() ) ;
buf.append( ' ' ).append( tuple.typeClass ) ;
buf.append( '[' ).append( tuple.length ).append( ']' ) ;
- buf.append( '[' ).append( new String( (byte[]) tuple.getValue() ) ) ;
+ buf.append( '[' ).append( new String( tuple.getValue().array() ) ) ;
buf.append( ']' ) ;
for ( int ii = 0; ii < children.size(); ii++ )
{