Class: Rex::Java::Serialization::Model::NewClass
- Includes:
- Contents
- Defined in:
- lib/rex/java/serialization/model/new_class.rb
Overview
This class provides a NewArray (Java Array) representation
Constant Summary
Constants included from Rex::Java::Serialization
BASE_WIRE_HANDLE, OBJECT_TYPE_CODES, PRIMITIVE_TYPE_CODES, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, TC_ARRAY, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING, TYPE_CODES
Instance Attribute Summary collapse
-
#array_description ⇒ Java::Serialization::Model::ClassDesc
The description of the class.
-
#class_description ⇒ Object
Returns the value of attribute class_description.
Attributes inherited from Element
Instance Method Summary collapse
-
#decode(io) ⇒ self
Deserializes a Rex::Java::Serialization::Model::NewClass.
-
#encode ⇒ String
Serializes the Rex::Java::Serialization::Model::NewClass.
-
#initialize(stream = nil) ⇒ NewClass
constructor
A new instance of NewClass.
-
#to_s ⇒ String
Creates a print-friendly string representation.
Methods included from Contents
#decode_content, #encode_content, #print_class, #print_content
Methods inherited from Element
Constructor Details
#initialize(stream = nil) ⇒ NewClass
Returns a new instance of NewClass.
17 18 19 20 |
# File 'lib/rex/java/serialization/model/new_class.rb', line 17 def initialize(stream = nil) super(stream) self.class_description = nil end |
Instance Attribute Details
#array_description ⇒ Java::Serialization::Model::ClassDesc
Returns The description of the class.
14 |
# File 'lib/rex/java/serialization/model/new_class.rb', line 14 attr_accessor :class_description |
#class_description ⇒ Object
Returns the value of attribute class_description.
14 15 16 |
# File 'lib/rex/java/serialization/model/new_class.rb', line 14 def class_description @class_description end |
Instance Method Details
#decode(io) ⇒ self
Deserializes a Rex::Java::Serialization::Model::NewClass
27 28 29 30 31 32 |
# File 'lib/rex/java/serialization/model/new_class.rb', line 27 def decode(io) self.class_description = ClassDesc.decode(io, stream) stream.add_reference(self) unless stream.nil? self end |
#encode ⇒ String
Serializes the Rex::Java::Serialization::Model::NewClass
38 39 40 41 42 43 44 45 |
# File 'lib/rex/java/serialization/model/new_class.rb', line 38 def encode unless class_description.kind_of?(ClassDesc) raise Rex::Java::Serialization::EncodeError, 'Failed to serialize NewClass' end encoded = '' encoded << class_description.encode end |
#to_s ⇒ String
Creates a print-friendly string representation
50 51 52 |
# File 'lib/rex/java/serialization/model/new_class.rb', line 50 def to_s print_content(class_description) end |