org.apache.hadoop.record
Class XmlRecordOutput

java.lang.Object
  extended by org.apache.hadoop.record.XmlRecordOutput
All Implemented Interfaces:
RecordOutput

public class XmlRecordOutput
extends java.lang.Object
implements RecordOutput

XML Serializer.


Constructor Summary
XmlRecordOutput(java.io.OutputStream out)
          Creates a new instance of XmlRecordOutput
 
Method Summary
 void endMap(java.util.TreeMap v, java.lang.String tag)
          Mark the end of a serialized map.
 void endRecord(Record r, java.lang.String tag)
          Mark the end of a serialized record.
 void endVector(java.util.ArrayList v, java.lang.String tag)
          Mark the end of a serialized vector.
 void startMap(java.util.TreeMap v, java.lang.String tag)
          Mark the start of a map to be serialized.
 void startRecord(Record r, java.lang.String tag)
          Mark the start of a record to be serialized.
 void startVector(java.util.ArrayList v, java.lang.String tag)
          Mark the start of a vector to be serialized.
 void writeBool(boolean b, java.lang.String tag)
          Write a boolean to serialized record.
 void writeBuffer(Buffer buf, java.lang.String tag)
          Write a buffer to serialized record.
 void writeByte(byte b, java.lang.String tag)
          Write a byte to serialized record.
 void writeDouble(double d, java.lang.String tag)
          Write a double precision floating point number to serialized record.
 void writeFloat(float f, java.lang.String tag)
          Write a single-precision float to serialized record.
 void writeInt(int i, java.lang.String tag)
          Write an integer to serialized record.
 void writeLong(long l, java.lang.String tag)
          Write a long integer to serialized record.
 void writeString(java.lang.String s, java.lang.String tag)
          Write a unicode string to serialized record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRecordOutput

public XmlRecordOutput(java.io.OutputStream out)
Creates a new instance of XmlRecordOutput

Method Detail

writeByte

public void writeByte(byte b,
                      java.lang.String tag)
               throws java.io.IOException
Description copied from interface: RecordOutput
Write a byte to serialized record.

Specified by:
writeByte in interface RecordOutput
Parameters:
b - Byte to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeBool

public void writeBool(boolean b,
                      java.lang.String tag)
               throws java.io.IOException
Description copied from interface: RecordOutput
Write a boolean to serialized record.

Specified by:
writeBool in interface RecordOutput
Parameters:
b - Boolean to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeInt

public void writeInt(int i,
                     java.lang.String tag)
              throws java.io.IOException
Description copied from interface: RecordOutput
Write an integer to serialized record.

Specified by:
writeInt in interface RecordOutput
Parameters:
i - Integer to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeLong

public void writeLong(long l,
                      java.lang.String tag)
               throws java.io.IOException
Description copied from interface: RecordOutput
Write a long integer to serialized record.

Specified by:
writeLong in interface RecordOutput
Parameters:
l - Long to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeFloat

public void writeFloat(float f,
                       java.lang.String tag)
                throws java.io.IOException
Description copied from interface: RecordOutput
Write a single-precision float to serialized record.

Specified by:
writeFloat in interface RecordOutput
Parameters:
f - Float to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeDouble

public void writeDouble(double d,
                        java.lang.String tag)
                 throws java.io.IOException
Description copied from interface: RecordOutput
Write a double precision floating point number to serialized record.

Specified by:
writeDouble in interface RecordOutput
Parameters:
d - Double to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeString

public void writeString(java.lang.String s,
                        java.lang.String tag)
                 throws java.io.IOException
Description copied from interface: RecordOutput
Write a unicode string to serialized record.

Specified by:
writeString in interface RecordOutput
Parameters:
s - String to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeBuffer

public void writeBuffer(Buffer buf,
                        java.lang.String tag)
                 throws java.io.IOException
Description copied from interface: RecordOutput
Write a buffer to serialized record.

Specified by:
writeBuffer in interface RecordOutput
Parameters:
buf - Buffer to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

startRecord

public void startRecord(Record r,
                        java.lang.String tag)
                 throws java.io.IOException
Description copied from interface: RecordOutput
Mark the start of a record to be serialized.

Specified by:
startRecord in interface RecordOutput
Parameters:
r - Record to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

endRecord

public void endRecord(Record r,
                      java.lang.String tag)
               throws java.io.IOException
Description copied from interface: RecordOutput
Mark the end of a serialized record.

Specified by:
endRecord in interface RecordOutput
Parameters:
r - Record to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

startVector

public void startVector(java.util.ArrayList v,
                        java.lang.String tag)
                 throws java.io.IOException
Description copied from interface: RecordOutput
Mark the start of a vector to be serialized.

Specified by:
startVector in interface RecordOutput
Parameters:
v - Vector to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

endVector

public void endVector(java.util.ArrayList v,
                      java.lang.String tag)
               throws java.io.IOException
Description copied from interface: RecordOutput
Mark the end of a serialized vector.

Specified by:
endVector in interface RecordOutput
Parameters:
v - Vector to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

startMap

public void startMap(java.util.TreeMap v,
                     java.lang.String tag)
              throws java.io.IOException
Description copied from interface: RecordOutput
Mark the start of a map to be serialized.

Specified by:
startMap in interface RecordOutput
Parameters:
v - Map to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

endMap

public void endMap(java.util.TreeMap v,
                   java.lang.String tag)
            throws java.io.IOException
Description copied from interface: RecordOutput
Mark the end of a serialized map.

Specified by:
endMap in interface RecordOutput
Parameters:
v - Map to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization


Copyright © 2009 The Apache Software Foundation