NAME

Mojo::ByteStream - Text And Bytestream Manipulation

SYNOPSIS

use Mojo::ByteStream;

my $stream = Mojo::ByteStream->new('foobarbaz');

$stream->camelize;
$stream->decamelize;
$stream->b64_encode;
$stream->b64_decode;
$stream->encode('utf8');
$stream->decode('utf8');
$stream->md5_sum;
$stream->qp_decode;
$stream->qp_encode;
$stream->quote;
$stream->unquote;
$stream->url_escape;
$stream->url_sanitize;
$stream->url_unescape;

my $stream_length = $stream->stream_length;

my $stream2 = $stream->clone;
print $stream2->as_string;

# Chained
my $stream = Mojo::ByteStream->new('foo bar baz')->quote;
$stream = $stream->unquote->encode('utf8)->b64_encode;
print "$stream";

DESCRIPTION

Mojo::ByteStream provides portable text and bytestream manipulation functions.

ATTRIBUTES

stream_length

my $stream_length = $stream->stream_length;

METHODS

Mojo::ByteStream inherits all methods from Mojo::Base and implements the following new ones.

new

my $stream = Mojo::ByteStream->new($string);

as_string

my $string = $stream->as_string;

b64_decode

$stream = $stream->b64_decode;

b64_encode

$stream = $stream->b64_encode;

camelize

$stream = $stream->camelize;

clone

my $stream2 = $stream->clone;

decamelize

$stream = $stream->decamelize;

decode

$stream = $stream->decode($encoding);

encode

$stream = $stream->encode($encoding);

md5_sum

$stream = $stream->md5_sum;

qp_decode

$stream = $stream->qp_decode;

qp_encode

$stream = $stream->qp_encode;

quote

$stream = $stream->quote;

unquote

$stream = $stream->unquote;

url_escape

$stream = $stream->url_escape;

url_sanitize

$stream = $stream->url_sanitize;

url_unescape

$stream = $stream->url_unescape;

SEE ALSO

Digest::MD5, Encode, MIME::Base64, MIME::QuotedPrint