JavaBin - Apache Solr JavaBin (de)serializer
use JavaBin; my $result = from_javabin $binary_data;
JavaBin is a compact binary format used by Apache Solr.
For more information on this format see the Solr Wiki.
This package provides a deserializer for this format, with a serializer planned.
my $result = from_javabin $binary_data;
Accepts one argument, a binary string of containing the JavaBin.
Returns a scalar representation of the data, be that undef, number, string, or reference.
This function does no error checking, hand it invalid JavaBin and it will probably die.
To (de)serialize long floats and ints this package requires a 64bit Perl. That said, it won't actually throw unless it encounters such data, and therefore the tests for such data are skipped on 32bit platforms.
Technically this limitation could be worked around by use of bigint or such. But the added complexity and maintanace cost would outweight the benifit.
Due to the differences between Java and Perl not all data structures can be mapped one-to-one.
An example of such mapping is a Java interator whcih becomes a Perl array during deserialization. Additionally a Java HashMap, Named List, or Ordered Map will become a Perl hash.
This package was inspired by the Ruby JavaBin library. Both that library and the Java JavaBin library proved very helpful in understanding JavaBin.
James Raspass <firstname.lastname@example.org>
This software is copyright (c) 2013 by James Raspass <email@example.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.