public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'hosts', 'type' => TType::LST, 'etype' => TType::STRING, 'elem' => array('type' => TType::STRING)), 2 => array('var' => 'names', 'type' => TType::LST, 'etype' => TType::STRING, 'elem' => array('type' => TType::STRING)), 3 => array('var' => 'offset', 'type' => TType::I64), 4 => array('var' => 'length', 'type' => TType::I64));
     }
     if (is_array($vals)) {
         if (isset($vals['hosts'])) {
             $this->hosts = $vals['hosts'];
         }
         if (isset($vals['names'])) {
             $this->names = $vals['names'];
         }
         if (isset($vals['offset'])) {
             $this->offset = $vals['offset'];
         }
         if (isset($vals['length'])) {
             $this->length = $vals['length'];
         }
     }
 }
 public function read($input)
 {
     $xfer = 0;
     $fname = null;
     $ftype = 0;
     $fid = 0;
     $xfer += $input->readStructBegin($fname);
     while (true) {
         $xfer += $input->readFieldBegin($fname, $ftype, $fid);
         if ($ftype == TType::STOP) {
             break;
         }
         switch ($fid) {
             case 0:
                 if ($ftype == TType::LST) {
                     $this->success = array();
                     $_size21 = 0;
                     $_etype24 = 0;
                     $xfer += $input->readListBegin($_etype24, $_size21);
                     for ($_i25 = 0; $_i25 < $_size21; ++$_i25) {
                         $elem26 = null;
                         $elem26 = new BlockLocation();
                         $xfer += $elem26->read($input);
                         $this->success[] = $elem26;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 1:
                 if ($ftype == TType::STRUCT) {
                     $this->ouch = new ThriftIOException();
                     $xfer += $this->ouch->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }