| 1 | package Hessian::Deserializer::Binary; | ||
| 2 | |||
| 3 | 32 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | # | ||
| 6 | 32 | ▶ | use feature "switch"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | ##use Smart::Comments; | ||
| 8 | |||
| 9 | 0 | ▶ | sub read_binary_handle_chunk { #{{{ |
|
Subroutine
read_binary_handle_chunk: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 10 | 0 | my ( $self, $first_bit ) = @_; | |
| 11 | ### read_binary_handle_chunk | ||
| 12 | 0 | my $input_handle = $self->input_handle(); | |
| 13 | 0 | my ($data, $length ); | |
| 14 | 0 | given ($first_bit) { | |
| 15 | 0 | when (/[\x42\x62]/) { | |
| 16 | 0 | read $input_handle, $data, 2; | |
| 17 | 0 | $length = unpack "n", $data; | |
| 18 | } | ||
| 19 | 0 | when (/[\x20-\x2f]/) { | |
| 20 | 0 | my $raw_octet = "\x00" . $first_bit; | |
| 21 | 0 | $length = unpack 'n', $raw_octet; | |
| 22 | 0 | $length -= 0x20; | |
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | |||
| 27 | 0 | my $binary = $self->read_from_inputhandle($length); | |
| 28 | 0 | return $binary; | |
| 29 | } | ||
| 30 | |||
| 31 | 32 | "one, but we're not the same"; | |
| 32 | |||
| 33 | __END__ | ||