diff --git a/include/ndnboost/iostreams/detail/absolute_path.hpp b/include/ndnboost/iostreams/detail/absolute_path.hpp
new file mode 100644
index 0000000..40947ec
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/absolute_path.hpp
@@ -0,0 +1,46 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+
+ * File:        ndnboost/iostreams/detail/execute.hpp
+ * Date:        Thu Dec 06 13:21:54 MST 2007
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Defines the function ndnboost::iostreams::detail::absolute_path, used for 
+ * debug output for mapped files.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
+
+#include <string>
+#include <ndnboost/iostreams/detail/config/windows_posix.hpp>
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+# include <cctype>
+#endif
+#include <ndnboost/iostreams/detail/current_directory.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+// Resolves the given path relative to the current working directory
+inline std::string absolute_path(const std::string& path)
+{
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+    return path.size() && (path[0] == '/' || path[0] == '\\') ||
+           path.size() > 1 && std::isalpha(path[0]) && path[1] == ':' ?
+               path :
+               current_directory() + '\\' + path;
+#else // #ifdef NDNBOOST_IOSTREAMS_WINDOWS
+    return path.size() && (path[0] == '/') ?
+        path :
+        current_directory() + '/' + path;
+#endif // #ifdef NDNBOOST_IOSTREAMS_WINDOWS
+}
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/access_control.hpp b/include/ndnboost/iostreams/detail/access_control.hpp
new file mode 100644
index 0000000..f06afa5
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/access_control.hpp
@@ -0,0 +1,87 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Contains the definition of the class template access_control, which
+// allows the type of inheritance from a provided base class to be specified 
+// using a template parameter.
+
+
+#ifndef NDNBOOST_IOSTREAMS_ACCESS_CONTROL_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_ACCESS_CONTROL_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/iostreams/detail/select.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+
+namespace ndnboost { namespace iostreams {
+
+struct protected_ { };  // Represents protected inheritance.
+struct public_ { };     // Represents public inheritance.
+
+
+namespace detail {
+
+    // Implements protected inheritance.
+    template<typename U>
+    struct prot_ : protected U 
+    { 
+        prot_() { }
+        template<typename V> prot_(V v) : U(v) { }
+    };
+
+    // Implements public inheritance.
+    template<typename U> struct pub_ : public U { 
+        pub_() { }
+        template<typename V> pub_(V v) : U(v) { }
+    };
+
+//
+// Used to deduce the base type for the template access_control.
+//
+template<typename T, typename Access>
+struct access_control_base {
+    typedef int                                 bad_access_specifier;
+    typedef typename 
+            iostreams::select<  // Disambiguation for Tru64
+                ::ndnboost::is_same<
+                    Access, protected_
+                >,                              prot_<T>,
+                ::ndnboost::is_same<
+                    Access, public_
+                >,                              pub_<T>,
+                else_,                          bad_access_specifier
+            >::type                             type;
+};
+
+} // End namespace detail.
+
+//
+// Template name: access_control.
+// Description: Allows the type of inheritance from a provided base class
+//      to be specified using an int template parameter.
+// Template parameters:
+//      Base - The class from which to inherit (indirectly.)
+//      Access - The type of access desired. Must be one of the 
+//          values access_base::prot or access_base::pub.
+//
+template< typename T, typename Access,
+          typename Base = // VC6 workaraound (Compiler Error C2516)
+              typename detail::access_control_base<T, Access>::type >
+struct access_control : public Base { 
+    access_control() { }
+    template<typename U> explicit access_control(U u) : Base(u) { }
+};
+
+//----------------------------------------------------------------------------//
+
+} } // End namespaces iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_ACCESS_CONTROL_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/adapter/concept_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/concept_adapter.hpp
new file mode 100644
index 0000000..d182bee
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/concept_adapter.hpp
@@ -0,0 +1,287 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONCEPT_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONCEPT_ADAPTER_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>                             // SFINAE.
+#include <ndnboost/iostreams/concepts.hpp>
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/adapter/non_blocking_adapter.hpp>
+#include <ndnboost/iostreams/detail/call_traits.hpp>
+#include <ndnboost/iostreams/detail/char_traits.hpp>
+#include <ndnboost/iostreams/detail/dispatch.hpp>
+#include <ndnboost/iostreams/detail/error.hpp>
+#include <ndnboost/iostreams/detail/streambuf.hpp>        // pubsync.
+#include <ndnboost/iostreams/detail/config/unreachable_return.hpp>
+#include <ndnboost/iostreams/device/null.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/throw_exception.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp>  // MSVC.
+
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Category> struct device_wrapper_impl;
+template<typename Category> struct flt_wrapper_impl;
+
+template<typename T>
+class concept_adapter {
+private:
+    typedef typename detail::value_type<T>::type       value_type;
+    typedef typename dispatch<T, input, output>::type  input_tag;
+    typedef typename dispatch<T, output, input>::type  output_tag;
+    typedef typename
+            mpl::if_<
+                is_device<T>,
+                device_wrapper_impl<input_tag>,
+                flt_wrapper_impl<input_tag>
+            >::type                                    input_impl;
+    typedef typename
+            mpl::if_<
+                is_device<T>,
+                device_wrapper_impl<output_tag>,
+                flt_wrapper_impl<output_tag>
+            >::type                                    output_impl;
+    typedef typename
+            mpl::if_<
+                is_device<T>,
+                device_wrapper_impl<any_tag>,
+                flt_wrapper_impl<any_tag>
+            >::type                                    any_impl;
+public:
+    typedef typename char_type_of<T>::type             char_type;
+    typedef typename category_of<T>::type              category;
+
+    explicit concept_adapter(const reference_wrapper<T>& ref) : t_(ref.get())
+    { NDNBOOST_STATIC_ASSERT(is_std_io<T>::value); }
+    explicit concept_adapter(const T& t) : t_(t)
+    { NDNBOOST_STATIC_ASSERT(!is_std_io<T>::value); }
+
+    T& operator*() { return t_; }
+    T* operator->() { return &t_; }
+
+    std::streamsize read(char_type* s, std::streamsize n)
+    { return this->read(s, n, (basic_null_source<char_type>*) 0); }
+
+    template<typename Source>
+    std::streamsize read(char_type* s, std::streamsize n, Source* src)
+    { return input_impl::read(t_, src, s, n); }
+
+    std::streamsize write(const char_type* s, std::streamsize n)
+    { return this->write(s, n, (basic_null_sink<char_type>*) 0); }
+
+    template<typename Sink>
+    std::streamsize write(const char_type* s, std::streamsize n, Sink* snk)
+    { return output_impl::write(t_, snk, s, n); }
+
+    std::streampos seek( stream_offset off, NDNBOOST_IOS::seekdir way,
+                         NDNBOOST_IOS::openmode which )
+    { 
+        return this->seek( off, way, which, 
+                           (basic_null_device<char_type, seekable>*) 0); 
+    }
+
+    template<typename Device>
+    std::streampos seek( stream_offset off, NDNBOOST_IOS::seekdir way,
+                         NDNBOOST_IOS::openmode which, Device* dev )
+    { return any_impl::seek(t_, dev, off, way, which); }
+
+    void close(NDNBOOST_IOS::openmode which)
+    { this->close(which, (basic_null_device<char_type, seekable>*) 0); }
+
+    template<typename Device>
+    void close(NDNBOOST_IOS::openmode which, Device* dev)
+    { any_impl::close(t_, dev, which); }
+
+    template<typename Device>
+    bool flush( Device* dev )
+    {
+        bool result = any_impl::flush(t_, dev);
+        if (dev && dev->NDNBOOST_IOSTREAMS_PUBSYNC() == -1)
+            result = false;
+        return result;
+    }
+
+    template<typename Locale> // Avoid dependency on <locale>
+    void imbue(const Locale& loc) { iostreams::imbue(t_, loc); }
+
+    std::streamsize optimal_buffer_size() const
+    { return iostreams::optimal_buffer_size(t_); }
+public:
+    concept_adapter& operator=(const concept_adapter&);
+    value_type t_;
+};
+
+//------------------Specializations of device_wrapper_impl--------------------//
+
+template<>
+struct device_wrapper_impl<any_tag> {
+    template<typename Device, typename Dummy>
+    static std::streampos 
+    seek( Device& dev, Dummy*, stream_offset off, 
+          NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which )
+    { 
+        typedef typename category_of<Device>::type category;
+        return seek(dev, off, way, which, category()); 
+    }
+
+    template<typename Device>
+    static std::streampos 
+    seek( Device&, stream_offset, NDNBOOST_IOS::seekdir, 
+          NDNBOOST_IOS::openmode, any_tag )
+    { 
+        ndnboost::throw_exception(cant_seek());
+        NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(0)
+    }
+
+    template<typename Device>
+    static std::streampos 
+    seek( Device& dev, stream_offset off, 
+          NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which, 
+          random_access )
+    { 
+        return iostreams::seek(dev, off, way, which); 
+    }
+
+    template<typename Device, typename Dummy>
+    static void close(Device& dev, Dummy*, NDNBOOST_IOS::openmode which)
+    { iostreams::close(dev, which); }
+
+    template<typename Device, typename Dummy>
+    static bool flush(Device& dev, Dummy*)
+    { return iostreams::flush(dev); }
+};
+
+
+template<>
+struct device_wrapper_impl<input> : device_wrapper_impl<any_tag>  {
+    template<typename Device, typename Dummy>
+    static std::streamsize
+    read( Device& dev, Dummy*, typename char_type_of<Device>::type* s,
+          std::streamsize n )
+    { return iostreams::read(dev, s, n); }
+
+    template<typename Device, typename Dummy>
+    static std::streamsize 
+    write( Device&, Dummy*, const typename char_type_of<Device>::type*,
+           std::streamsize )
+    { ndnboost::throw_exception(cant_write());
+      NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
+};
+
+template<>
+struct device_wrapper_impl<output> {
+    template<typename Device, typename Dummy>
+    static std::streamsize
+    read(Device&, Dummy*, typename char_type_of<Device>::type*, std::streamsize)
+    { ndnboost::throw_exception(cant_read());
+      NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
+
+    template<typename Device, typename Dummy>
+    static std::streamsize 
+    write( Device& dev, Dummy*, const typename char_type_of<Device>::type* s,
+           std::streamsize n )
+    { return iostreams::write(dev, s, n); }
+};
+
+//------------------Specializations of flt_wrapper_impl--------------------//
+
+template<>
+struct flt_wrapper_impl<any_tag> {
+    template<typename Filter, typename Device>
+    static std::streampos
+    seek( Filter& f, Device* dev, stream_offset off,
+          NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which )
+    {
+        typedef typename category_of<Filter>::type category;
+        return seek(f, dev, off, way, which, category());
+    }
+
+    template<typename Filter, typename Device>
+    static std::streampos
+    seek( Filter&, Device*, stream_offset,
+          NDNBOOST_IOS::seekdir, NDNBOOST_IOS::openmode, any_tag )
+    { ndnboost::throw_exception(cant_seek());
+      NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
+
+    template<typename Filter, typename Device>
+    static std::streampos
+    seek( Filter& f, Device* dev, stream_offset off,
+          NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which,
+          random_access tag )
+    {
+        typedef typename category_of<Filter>::type category;
+        return seek(f, dev, off, way, which, tag, category());
+    }
+
+    template<typename Filter, typename Device>
+    static std::streampos
+    seek( Filter& f, Device* dev, stream_offset off,
+          NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode,
+          random_access, any_tag )
+    { return f.seek(*dev, off, way); }
+
+    template<typename Filter, typename Device>
+    static std::streampos
+    seek( Filter& f, Device* dev, stream_offset off,
+          NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which,
+          random_access, two_sequence )
+    { return f.seek(*dev, off, way, which);  }
+
+    template<typename Filter, typename Device>
+    static void close(Filter& f, Device* dev, NDNBOOST_IOS::openmode which)
+    { iostreams::close(f, *dev, which); }
+
+    template<typename Filter, typename Device>
+    static bool flush(Filter& f, Device* dev)
+    { return iostreams::flush(f, *dev); }
+};
+
+template<>
+struct flt_wrapper_impl<input> {
+    template<typename Filter, typename Source>
+    static std::streamsize
+    read( Filter& f, Source* src, typename char_type_of<Filter>::type* s,
+          std::streamsize n )
+    { return iostreams::read(f, *src, s, n); }
+
+    template<typename Filter, typename Sink>
+    static std::streamsize 
+    write( Filter&, Sink*, const typename char_type_of<Filter>::type*, 
+           std::streamsize )
+    { ndnboost::throw_exception(cant_write());
+      NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
+};
+
+template<>
+struct flt_wrapper_impl<output> {
+    template<typename Filter, typename Source>
+    static std::streamsize
+    read(Filter&, Source*, typename char_type_of<Filter>::type*,std::streamsize)
+    { ndnboost::throw_exception(cant_read());
+      NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
+
+    template<typename Filter, typename Sink>
+    static std::streamsize 
+    write( Filter& f, Sink* snk, const typename char_type_of<Filter>::type* s,
+           std::streamsize n )
+    { return iostreams::write(f, *snk, s, n); }
+};
+
+//----------------------------------------------------------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp>  // MSVC.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONCEPT_ADAPTER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/adapter/device_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/device_adapter.hpp
new file mode 100644
index 0000000..aa82c7a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/device_adapter.hpp
@@ -0,0 +1,67 @@
+/*
+ * Defines the class template ndnboost::iostreams::detail::device_adapter,
+ * a convenience base class for device adapters.
+ *
+ * File:        ndnboost/iostreams/detail/adapter/filter_adapter.hpp
+ * Date:        Mon Nov 26 14:35:48 MST 2007
+ * 
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
+
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/call_traits.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/static_assert.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename T>
+class device_adapter {
+private:
+    typedef typename detail::value_type<T>::type value_type;
+    typedef typename detail::param_type<T>::type param_type;
+public:
+    explicit device_adapter(param_type t) : t_(t) { }
+    T& component() { return t_; }
+
+    void close() 
+    {
+        detail::close_all(t_);
+    }
+
+    void close(NDNBOOST_IOS::openmode which) 
+    { 
+        iostreams::close(t_, which); 
+    }
+
+    bool flush() 
+    { 
+        return iostreams::flush(t_); 
+    }
+
+    template<typename Locale> // Avoid dependency on <locale>
+    void imbue(const Locale& loc) { iostreams::imbue(t_, loc); }
+
+    std::streamsize optimal_buffer_size() const 
+    { return iostreams::optimal_buffer_size(t_); }
+public:
+    value_type t_;
+};
+
+//----------------------------------------------------------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/adapter/direct_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/direct_adapter.hpp
new file mode 100644
index 0000000..99eebf9
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/direct_adapter.hpp
@@ -0,0 +1,281 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_DIRECT_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_DIRECT_ADAPTER_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp>       // SFINAE, MSVC, put ptrdiff_t in std.
+#include <algorithm>              // copy, min.
+#include <cstddef>                // ptrdiff_t.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/config/limits.hpp>        // forwarding.
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>  // locale.
+#include <ndnboost/iostreams/detail/double_object.hpp>
+#include <ndnboost/iostreams/detail/error.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>  // openmode, seekdir, int types.
+#include <ndnboost/iostreams/traits.hpp>      // mode_of, is_direct.
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/mpl/bool.hpp> 
+#include <ndnboost/mpl/or.hpp> 
+#include <ndnboost/preprocessor/iteration/local.hpp>
+#include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp> // VC7.1
+
+namespace ndnboost { namespace iostreams { namespace detail {
+                    
+//------------------Definition of direct_adapter_base-------------------------//
+
+// Put all initialization in base class to faciliate forwarding.
+template<typename Direct>
+class direct_adapter_base {
+public:
+    typedef typename char_type_of<Direct>::type  char_type;
+    typedef typename mode_of<Direct>::type       mode_type;
+    struct category 
+        : mode_type,
+          device_tag,
+          closable_tag
+          #ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+          , localizable_tag
+          #endif
+        { };
+protected:
+    explicit direct_adapter_base(const Direct& d);
+    typedef is_convertible<category, two_sequence> is_double;
+    struct pointers {
+        char_type *beg, *ptr, *end;
+    };
+    void init_input(mpl::true_);
+    void init_input(mpl::false_) { }
+    void init_output(mpl::true_);
+    void init_output(mpl::false_) { }
+    double_object<pointers, is_double>  ptrs_;
+    Direct                              d_;
+};
+
+template<typename Direct>
+class direct_adapter : private direct_adapter_base<Direct> {
+private:
+    typedef direct_adapter_base<Direct>      base_type;
+    typedef typename base_type::pointers     pointers;
+    typedef typename base_type::is_double    is_double;
+    using base_type::ptrs_;
+    using base_type::d_;
+public:
+    typedef typename base_type::char_type    char_type;
+    typedef typename base_type::category     category;
+
+        // Constructors
+
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1310)
+    direct_adapter(const Direct& d) : base_type(d) { }   
+    direct_adapter(const direct_adapter& d) : base_type(d) { }
+# define NDNBOOST_PP_LOCAL_LIMITS (1, NDNBOOST_IOSTREAMS_MAX_FORWARDING_ARITY)
+#else
+    template<typename U>
+    struct is_direct
+        : mpl::or_< 
+              is_same<U, direct_adapter<Direct> >, 
+              is_same<U, Direct> 
+          >
+        { };
+    template<typename U>
+    direct_adapter(const U& u) 
+        : base_type(forward(u, is_direct<U>()))
+        { }
+# define NDNBOOST_PP_LOCAL_LIMITS (2, NDNBOOST_IOSTREAMS_MAX_FORWARDING_ARITY)
+#endif
+
+#define NDNBOOST_PP_LOCAL_MACRO(n) \
+    template<NDNBOOST_PP_ENUM_PARAMS(n, typename P)> \
+    direct_adapter(NDNBOOST_PP_ENUM_BINARY_PARAMS(n, const P, &p)) \
+        : base_type(Direct(NDNBOOST_PP_ENUM_PARAMS(n, p))) \
+        { } \
+    /**/
+#include NDNBOOST_PP_LOCAL_ITERATE()
+#undef NDNBOOST_PP_LOCAL_MACRO
+
+        // Device interface.
+
+    std::streamsize read(char_type* s, std::streamsize n);
+    std::streamsize write(const char_type* s, std::streamsize n);
+    std::streampos seek( stream_offset, NDNBOOST_IOS::seekdir,
+                         NDNBOOST_IOS::openmode = NDNBOOST_IOS::in | NDNBOOST_IOS::out );
+    void close();
+    void close(NDNBOOST_IOS::openmode which);
+#ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+    void imbue(const std::locale&);
+#endif
+
+        // Direct device access.
+
+    Direct& operator*() { return d_; }
+    Direct* operator->() { return &d_; }
+#if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1310)
+private:
+    template<typename U>
+    static Direct forward(const U& u, mpl::true_) { return u; }
+    template<typename U>
+    static Direct forward(const U& u, mpl::false_) { return Direct(u); }
+#endif
+};
+
+//--------------Definition of wrap_direct and unwrap_direct-------------------//
+
+template<typename Device>
+struct wrap_direct_traits 
+    : mpl::if_<
+          is_direct<Device>,
+          direct_adapter<Device>,
+          Device
+      >
+    { };
+
+template<typename Device>
+typename wrap_direct_traits<Device>::type
+inline wrap_direct(Device dev) 
+{ 
+    typedef typename wrap_direct_traits<Device>::type type;
+    return type(dev); 
+}
+
+template<typename Device>
+inline Device& unwrap_direct(Device& d) { return d; }  
+
+template<typename Device>
+inline Device& unwrap_direct(direct_adapter<Device>& d) { return *d; }  
+
+//--------------Implementation of direct_adapter_base-------------------------//
+
+template<typename Direct>
+direct_adapter_base<Direct>::direct_adapter_base(const Direct& d) : d_(d)
+{
+    init_input(is_convertible<category, input>());
+    init_output(is_convertible<category, output>());
+}
+
+template<typename Direct>
+void direct_adapter_base<Direct>::init_input(mpl::true_) 
+{
+    std::pair<char_type*, char_type*> seq = iostreams::input_sequence(d_);
+    ptrs_.first().beg = seq.first;
+    ptrs_.first().ptr = seq.first;
+    ptrs_.first().end = seq.second;
+}
+
+template<typename Direct>
+void direct_adapter_base<Direct>::init_output(mpl::true_) 
+{
+    std::pair<char_type*, char_type*> seq = iostreams::output_sequence(d_);
+    ptrs_.second().beg = seq.first;
+    ptrs_.second().ptr = seq.first;
+    ptrs_.second().end = seq.second;
+}
+
+//--------------Implementation of direct_adapter------------------------------//
+
+template<typename Direct>
+inline std::streamsize direct_adapter<Direct>::read
+    (char_type* s, std::streamsize n)
+{
+    using namespace std;
+    pointers& get = ptrs_.first();
+    std::streamsize avail = 
+        static_cast<std::streamsize>(get.end - get.ptr);
+    std::streamsize result = (std::min)(n, avail);
+    std::copy(get.ptr, get.ptr + result, s);
+    get.ptr += result;
+    return result != 0 ? result : -1;
+}
+
+template<typename Direct>
+inline std::streamsize direct_adapter<Direct>::write
+    (const char_type* s, std::streamsize n)
+{
+    using namespace std;
+    pointers& put = ptrs_.second();
+    if (n > static_cast<std::streamsize>(put.end - put.ptr))
+        ndnboost::throw_exception(write_area_exhausted());
+    std::copy(s, s + n, put.ptr);
+    put.ptr += n;
+    return n;
+}
+
+template<typename Direct>
+inline std::streampos direct_adapter<Direct>::seek
+    ( stream_offset off, NDNBOOST_IOS::seekdir way, 
+      NDNBOOST_IOS::openmode which )
+{
+    using namespace std;
+    pointers& get = ptrs_.first();
+    pointers& put = ptrs_.second();
+    if (way == NDNBOOST_IOS::cur && get.ptr != put.ptr)
+       ndnboost::throw_exception(bad_seek());
+    ptrdiff_t next = 0;
+    if ((which & NDNBOOST_IOS::in) || !is_double::value) {
+        if (way == NDNBOOST_IOS::beg)
+            next = off; 
+        else if (way == NDNBOOST_IOS::cur)
+            next = get.ptr - get.beg + off; 
+        else
+            next = get.end - get.beg + off; 
+        if (next >= 0 && next <= get.end - get.beg)
+            get.ptr = get.beg + next;
+        else
+            ndnboost::throw_exception(bad_seek());
+    }
+    if ((which & NDNBOOST_IOS::out) && is_double::value) {
+        if (way == NDNBOOST_IOS::beg)
+            next = off; 
+        else if (way == NDNBOOST_IOS::cur)
+            next = put.ptr - put.beg + off; 
+        else
+            next = put.end - put.beg + off; 
+        if (next >= 0 && next <= put.end - put.beg)
+            put.ptr = put.beg + next;
+        else
+            ndnboost::throw_exception(bad_seek());
+    }
+    return offset_to_position(next);
+}
+
+template<typename Direct>
+void direct_adapter<Direct>::close() 
+{ 
+    NDNBOOST_STATIC_ASSERT((!is_convertible<category, two_sequence>::value));
+    detail::close_all(d_);
+}
+
+template<typename Direct>
+void direct_adapter<Direct>::close(NDNBOOST_IOS::openmode which) 
+{ 
+    NDNBOOST_STATIC_ASSERT((is_convertible<category, two_sequence>::value));
+    ndnboost::iostreams::close(d_, which);
+}
+
+#ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+    template<typename Direct>
+    void direct_adapter<Direct>::imbue(const std::locale& loc) 
+    { ndnboost::iostreams::imbue(d_, loc); }
+#endif
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp>
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_DIRECT_ADAPTER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/adapter/filter_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/filter_adapter.hpp
new file mode 100644
index 0000000..fec4c45
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/filter_adapter.hpp
@@ -0,0 +1,69 @@
+/*
+ * Defines the class template ndnboost::iostreams::detail::filter_adapter,
+ * a convenience base class for filter adapters.
+ *
+ * File:        ndnboost/iostreams/detail/adapter/filter_adapter.hpp
+ * Date:        Mon Nov 26 14:35:48 MST 2007
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_FILTER_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_FILTER_ADAPTER_HPP_INCLUDED
+
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/call_traits.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/static_assert.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename T>
+class filter_adapter {
+private:
+    typedef typename detail::value_type<T>::type value_type;
+    typedef typename detail::param_type<T>::type param_type;
+public:
+    explicit filter_adapter(param_type t) : t_(t) { }
+    T& component() { return t_; }
+
+    template<typename Device>
+    void close(Device& dev) 
+    { 
+        detail::close_all(t_, dev); 
+    }
+
+    template<typename Device>
+    void close(Device& dev, NDNBOOST_IOS::openmode which) 
+    { 
+        iostreams::close(t_, dev, which); 
+    }
+
+    template<typename Device>
+    void flush(Device& dev) 
+    { 
+        return iostreams::flush(t_, dev); 
+    }
+
+    template<typename Locale> // Avoid dependency on <locale>
+    void imbue(const Locale& loc) { iostreams::imbue(t_, loc); }
+
+    std::streamsize optimal_buffer_size() const 
+    { return iostreams::optimal_buffer_size(t_); }
+public:
+    value_type t_;
+};
+
+//----------------------------------------------------------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_FILTER_ADAPTER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/adapter/mode_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/mode_adapter.hpp
new file mode 100644
index 0000000..46d5b64
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/mode_adapter.hpp
@@ -0,0 +1,123 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_MODE_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_MODE_ADAPTER_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+// Contains the definition of the class template mode_adapter, which allows
+// a filter or device to function as if it has a different i/o mode than that
+// deduced by the metafunction mode_of.
+
+#include <ndnboost/config.hpp>                // NDNBOOST_MSVC.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>  // openmode, seekdir, int types. 
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/iostreams/operations.hpp> 
+#include <ndnboost/mpl/if.hpp> 
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Mode, typename T>
+class mode_adapter {
+private:
+    struct empty_base { };
+public:
+    typedef typename wrapped_type<T>::type  component_type;
+    typedef typename char_type_of<T>::type  char_type;
+    struct category 
+        : Mode, 
+          device_tag,
+          mpl::if_<is_filter<T>, filter_tag, device_tag>,
+          mpl::if_<is_filter<T>, multichar_tag, empty_base>,
+          #if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
+              closable_tag, // VC6 can't see member close()!
+          #endif
+          localizable_tag
+        { };
+    explicit mode_adapter(const component_type& t) : t_(t) { }
+
+        // Device member functions.
+
+    std::streamsize read(char_type* s, std::streamsize n);
+    std::streamsize write(const char_type* s, std::streamsize n);
+    std::streampos seek( stream_offset off, NDNBOOST_IOS::seekdir way,
+                         NDNBOOST_IOS::openmode which = 
+                             NDNBOOST_IOS::in | NDNBOOST_IOS::out );
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
+    void close();
+    void close(NDNBOOST_IOS::openmode which);
+#endif
+
+        // Filter member functions.
+
+    template<typename Source>
+    std::streamsize read(Source& src, char_type* s, std::streamsize n)
+    { return iostreams::read(t_, src, s, n); }
+
+    template<typename Sink>
+    std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
+    { return iostreams::write(t_, snk, s, n); }
+
+    template<typename Device>
+    std::streampos seek(Device& dev, stream_offset off, NDNBOOST_IOS::seekdir way)
+    { return iostreams::seek(t_, dev, off, way); }
+
+    template<typename Device>
+    std::streampos seek( Device& dev, stream_offset off, 
+                         NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which  )
+    { return iostreams::seek(t_, dev, off, way, which); }
+
+    template<typename Device>
+    void close(Device& dev)
+    { detail::close_all(t_, dev); }
+
+    template<typename Device>
+    void close(Device& dev, NDNBOOST_IOS::openmode which)
+    { iostreams::close(t_, dev, which); }
+
+    template<typename Locale>
+    void imbue(const Locale& loc)
+    { iostreams::imbue(t_, loc); }
+private:
+    component_type t_;
+};
+                    
+//------------------Implementation of mode_adapter----------------------------//
+
+template<typename Mode, typename T>
+std::streamsize mode_adapter<Mode, T>::read
+    (char_type* s, std::streamsize n)
+{ return ndnboost::iostreams::read(t_, s, n); }
+
+template<typename Mode, typename T>
+std::streamsize mode_adapter<Mode, T>::write
+    (const char_type* s, std::streamsize n)
+{ return ndnboost::iostreams::write(t_, s, n); }
+
+template<typename Mode, typename T>
+std::streampos mode_adapter<Mode, T>::seek
+    (stream_offset off, NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which)
+{ return ndnboost::iostreams::seek(t_, off, way, which); }
+
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
+    template<typename Mode, typename T>
+    void mode_adapter<Mode, T>::close() 
+    { detail::close_all(t_); }
+
+    template<typename Mode, typename T>
+    void mode_adapter<Mode, T>::close(NDNBOOST_IOS::openmode which) 
+    { iostreams::close(t_, which); }
+#endif
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_MODE_ADAPTER_HPP_INCLUDED //-----//
diff --git a/include/ndnboost/iostreams/detail/adapter/non_blocking_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/non_blocking_adapter.hpp
new file mode 100644
index 0000000..1ba070c
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/non_blocking_adapter.hpp
@@ -0,0 +1,59 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_NON_BLOCKING_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_NON_BLOCKING_ADAPTER_HPP_INCLUDED
+
+#include <ndnboost/iostreams/detail/ios.hpp>  // streamsize, seekdir, openmode.
+#include <ndnboost/iostreams/read.hpp>
+#include <ndnboost/iostreams/seek.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/iostreams/write.hpp>
+
+namespace ndnboost { namespace iostreams {
+
+template<typename Device>
+class non_blocking_adapter {
+public:
+    typedef typename char_type_of<Device>::type char_type;
+    struct category
+        : mode_of<Device>::type, device_tag
+        { };
+    explicit non_blocking_adapter(Device& dev) : device_(dev) { }
+    std::streamsize read(char_type* s, std::streamsize n)
+    { 
+        std::streamsize result = 0;
+        while (result < n) {
+            std::streamsize amt = iostreams::read(device_, s, n);
+            if (amt == -1)
+                break;
+            result += amt;
+        }
+        return result != 0 ? result : -1;
+    }
+    std::streamsize write(const char_type* s, std::streamsize n)
+    { 
+        std::streamsize result = 0;
+        while (result < n) {
+            std::streamsize amt = 
+                iostreams::write(device_, s + result, n - result);
+            result += amt;
+        }
+        return result;    
+    }
+    std::streampos seek( stream_offset off, NDNBOOST_IOS::seekdir way,
+                         NDNBOOST_IOS::openmode which = 
+                             NDNBOOST_IOS::in | NDNBOOST_IOS::out )
+    { return iostreams::seek(device_, off, way, which); }
+public:
+    non_blocking_adapter& operator=(const non_blocking_adapter&);
+    Device& device_;
+};
+
+} } // End namespace iostreams.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_NON_BLOCKING_ADAPTER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/adapter/output_iterator_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/output_iterator_adapter.hpp
new file mode 100644
index 0000000..d9b6929
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/output_iterator_adapter.hpp
@@ -0,0 +1,41 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_OUTPUT_ITERATOR_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_OUTPUT_ITERATOR_ADAPTER_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <algorithm>                      // copy.
+#include <iosfwd>                         // streamsize.
+#include <ndnboost/iostreams/categories.hpp> // tags.
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Mode, typename Ch, typename OutIt>
+class output_iterator_adapter {
+public:
+    NDNBOOST_STATIC_ASSERT((is_convertible<Mode, output>::value));
+    typedef Ch        char_type;
+    typedef sink_tag  category;
+    explicit output_iterator_adapter(OutIt out) : out_(out) { }
+    std::streamsize write(const char_type* s, std::streamsize n) 
+    { 
+        std::copy(s, s + n, out_); 
+        return n; 
+    }
+private:
+    OutIt out_;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_OUTPUT_ITERATOR_ADAPTER_HPP_INCLUDED //-----//
diff --git a/include/ndnboost/iostreams/detail/adapter/range_adapter.hpp b/include/ndnboost/iostreams/detail/adapter/range_adapter.hpp
new file mode 100644
index 0000000..3789489
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/adapter/range_adapter.hpp
@@ -0,0 +1,187 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_RANGE_ADAPTER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_RANGE_ADAPTER_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <algorithm>                             // min.
+#include <ndnboost/assert.hpp>
+#include <cstddef>                               // ptrdiff_t.
+#include <iosfwd>                                // streamsize, streamoff.
+#include <ndnboost/detail/iterator.hpp>             // ndnboost::iterator_traits.
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/error.hpp>
+#include <ndnboost/iostreams/positioning.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+#include <ndnboost/utility/enable_if.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp>  // MSVC.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+// Used for simulated tag dispatch.
+template<typename Traversal> struct range_adapter_impl;
+
+//
+// Template name: range_adapter
+// Description: Device based on an instance of ndnboost::iterator_range.
+// Template parameters:
+//     Mode - A mode tag.
+//     Range - An instance of iterator_range.
+//
+template<typename Mode, typename Range>
+class range_adapter {
+private:
+    typedef typename Range::iterator                  iterator;
+    typedef ndnboost::detail::iterator_traits<iterator>  iter_traits;
+    typedef typename iter_traits::iterator_category   iter_cat;
+public:
+    typedef typename Range::value_type                char_type;
+    struct category : Mode, device_tag { };
+    typedef typename
+            mpl::if_<
+                is_convertible<
+                    iter_cat,
+                    std::random_access_iterator_tag
+                >,
+                std::random_access_iterator_tag,
+                std::forward_iterator_tag
+            >::type                                   tag;
+    typedef range_adapter_impl<tag>                   impl;
+
+    explicit range_adapter(const Range& rng);
+    range_adapter(iterator first, iterator last);
+    std::streamsize read(char_type* s, std::streamsize n);
+    std::streamsize write(const char_type* s, std::streamsize n);
+    std::streampos seek(stream_offset off, NDNBOOST_IOS::seekdir way);
+private:
+    iterator first_, cur_, last_;
+};
+
+//------------------Implementation of range_adapter---------------------------//
+
+template<typename Mode, typename Range>
+range_adapter<Mode, Range>::range_adapter(const Range& rng)
+    : first_(rng.begin()), cur_(rng.begin()), last_(rng.end()) { }
+
+template<typename Mode, typename Range>
+range_adapter<Mode, Range>::range_adapter(iterator first, iterator last)
+    : first_(first), cur_(first), last_(last) { }
+
+template<typename Mode, typename Range>
+inline std::streamsize range_adapter<Mode, Range>::read
+    (char_type* s, std::streamsize n)
+{ return impl::read(cur_, last_, s, n); }
+
+template<typename Mode, typename Range>
+inline std::streamsize range_adapter<Mode, Range>::write
+    (const char_type* s, std::streamsize n)
+{ return impl::write(cur_, last_, s, n); }
+
+
+template<typename Mode, typename Range>
+std::streampos range_adapter<Mode, Range>::seek
+    (stream_offset off, NDNBOOST_IOS::seekdir way)
+{ 
+    impl::seek(first_, cur_, last_, off, way); 
+    return offset_to_position(cur_ - first_);
+}
+
+//------------------Implementation of range_adapter_impl----------------------//
+
+template<>
+struct range_adapter_impl<std::forward_iterator_tag> {
+    template<typename Iter, typename Ch>
+    static std::streamsize read
+        (Iter& cur, Iter& last, Ch* s,std::streamsize n)
+    {
+        std::streamsize rem = n; // No. of chars remaining.
+        while (cur != last && rem-- > 0) *s++ = *cur++;
+        return n - rem != 0 ? n - rem : -1;
+    }
+
+    template<typename Iter, typename Ch>
+    static std::streamsize write
+        (Iter& cur, Iter& last, const Ch* s, std::streamsize n)
+    {
+        while (cur != last && n-- > 0) *cur++ = *s++;
+        if (cur == last && n > 0)
+            ndnboost::throw_exception(write_area_exhausted());
+        return n;
+    }
+};
+
+template<>
+struct range_adapter_impl<std::random_access_iterator_tag> {
+    template<typename Iter, typename Ch>
+    static std::streamsize read
+        (Iter& cur, Iter& last, Ch* s,std::streamsize n)
+    {
+        std::streamsize result = 
+            (std::min)(static_cast<std::streamsize>(last - cur), n);
+        if (result)
+            std::copy(cur, cur + result, s);
+        cur += result;
+        return result != 0 ? result : -1;
+    }
+
+    template<typename Iter, typename Ch>
+    static std::streamsize write
+        (Iter& cur, Iter& last, const Ch* s, std::streamsize n)
+    {
+        std::streamsize count =
+            (std::min)(static_cast<std::streamsize>(last - cur), n);
+        std::copy(s, s + count, cur);
+        cur += count;
+        if (count < n) 
+            ndnboost::throw_exception(write_area_exhausted());
+        return n;
+    }
+
+    template<typename Iter>
+    static void seek
+        ( Iter& first, Iter& cur, Iter& last, stream_offset off,
+          NDNBOOST_IOS::seekdir way )
+    {
+        using namespace std;
+        switch (way) {
+        case NDNBOOST_IOS::beg:
+            if (off > last - first || off < 0)
+                ndnboost::throw_exception(bad_seek());
+            cur = first + off;
+            break;
+        case NDNBOOST_IOS::cur:
+            {
+                std::ptrdiff_t newoff = cur - first + off;
+                if (newoff > last - first || newoff < 0)
+                    ndnboost::throw_exception(bad_seek());
+                cur += off;
+                break;
+            }
+        case NDNBOOST_IOS::end:
+            if (last - first + off < 0 || off > 0)
+                ndnboost::throw_exception(bad_seek());
+            cur = last + off;
+            break;
+        default:
+            NDNBOOST_ASSERT(0);
+        }
+    }
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp>  // MSVC.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_RANGE_ADAPTER_HPP_INCLUDED //---------------//
diff --git a/include/ndnboost/iostreams/detail/add_facet.hpp b/include/ndnboost/iostreams/detail/add_facet.hpp
new file mode 100644
index 0000000..32aa534
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/add_facet.hpp
@@ -0,0 +1,49 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Borrowed from <ndnboost/archive/add_facet.hpp>
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/config.hpp>  // NDNBOOST_DINKUMWARE_STDLIB.
+#include <ndnboost/detail/workaround.hpp>
+
+//------------------Definition of add_facet-----------------------------------//
+
+// Does STLport uses old Dinkumware locale?
+#if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && \
+    defined(_STLP_NO_OWN_IOSTREAMS) \
+    /**/
+#  if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
+#    define NDNBOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE
+#  endif
+#endif
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<class Facet>
+inline std::locale add_facet(const std::locale &l, Facet * f)
+{
+    return
+        #if NDNBOOST_WORKAROUND(NDNBOOST_DINKUMWARE_STDLIB, == 1) || \
+            defined(NDNBOOST_IOSTREMS_STLPORT_WITH_OLD_DINKUMWARE) \
+            /**/
+            std::locale(std::_Addfac(l, f));
+        #else
+            // standard compatible
+            std::locale(l, f);
+        #endif
+}
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_ADD_FACET_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/bool_trait_def.hpp b/include/ndnboost/iostreams/detail/bool_trait_def.hpp
new file mode 100644
index 0000000..361fa23
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/bool_trait_def.hpp
@@ -0,0 +1,49 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED     
+
+#include <ndnboost/config.hpp> // NDNBOOST_STATIC_CONSTANT.
+#include <ndnboost/iostreams/detail/template_params.hpp>
+#include <ndnboost/mpl/aux_/lambda_support.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/type_traits/detail/yes_no_type.hpp>
+ 
+// 
+// Macro name: NDNBOOST_IOSTREAMS_BOOL_TRAIT_DEF
+// Description: Used to generate the traits classes is_istream, is_ostream,
+//      etc.
+//
+#if NDNBOOST_WORKAROUND(__BORLANDC__, NDNBOOST_TESTED_AT(0x582))
+# define NDNBOOST_IOSTREAMS_TRAIT_NAMESPACE(trait)
+#else
+# define NDNBOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) NDNBOOST_PP_CAT(trait, _impl_):: 
+#endif
+#define NDNBOOST_IOSTREAMS_BOOL_TRAIT_DEF(trait, type, arity) \
+    namespace NDNBOOST_PP_CAT(trait, _impl_) { \
+      NDNBOOST_IOSTREAMS_TEMPLATE_PARAMS(arity, T) \
+      type_traits::yes_type helper \
+          (const volatile type NDNBOOST_IOSTREAMS_TEMPLATE_ARGS(arity, T)*); \
+      type_traits::no_type helper(...); \
+      template<typename T> \
+      struct impl { \
+           NDNBOOST_STATIC_CONSTANT(bool, value = \
+           (sizeof(NDNBOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) \
+              helper(static_cast<T*>(0))) == \
+                sizeof(type_traits::yes_type))); \
+      }; \
+    } \
+    template<typename T> \
+    struct trait \
+        : mpl::bool_<NDNBOOST_PP_CAT(trait, _impl_)::impl<T>::value> \
+    { NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(1, trait, (T)) }; \
+    /**/
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/broken_overload_resolution/forward.hpp b/include/ndnboost/iostreams/detail/broken_overload_resolution/forward.hpp
new file mode 100644
index 0000000..a2081ad
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/broken_overload_resolution/forward.hpp
@@ -0,0 +1,31 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>                     // NDNBOOST_STATIC_CONSANT.
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Device, typename U>
+struct forward_impl {
+    NDNBOOST_STATIC_CONSTANT(bool, value =
+        ( !is_same< U, Device >::value &&
+          !is_same< U, reference_wrapper<Device> >::value ));
+};
+
+template<typename Device, typename U>
+struct forward
+    : mpl::bool_<forward_impl<Device, U>::value>
+    { };
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/broken_overload_resolution/stream.hpp b/include/ndnboost/iostreams/detail/broken_overload_resolution/stream.hpp
new file mode 100644
index 0000000..6485f1f
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/broken_overload_resolution/stream.hpp
@@ -0,0 +1,184 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_HPP_INCLUDED
+
+#include <ndnboost/iostreams/detail/broken_overload_resolution/forward.hpp>
+
+namespace ndnboost { namespace iostreams {
+
+template< typename Device,
+          typename Tr =
+              NDNBOOST_IOSTREAMS_CHAR_TRAITS(
+                  NDNBOOST_DEDUCED_TYPENAME char_type_of<Device>::type
+              ),
+          typename Alloc =
+              std::allocator<
+                  NDNBOOST_DEDUCED_TYPENAME char_type_of<Device>::type
+              > >
+struct stream : detail::stream_base<Device, Tr, Alloc> {
+public:
+    typedef typename char_type_of<Device>::type  char_type;
+    struct category 
+        : mode_of<Device>::type,
+          closable_tag,
+          detail::stream_traits<Device, Tr>::stream_tag
+        { };
+    NDNBOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr)
+private:
+    typedef typename
+            detail::stream_traits<
+                Device, Tr
+            >::stream_type                       stream_type;
+public:
+    stream() { }
+    template<typename U0>
+    stream(const U0& u0)
+    {
+        open_impl(detail::forward<Device, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    stream(const U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    stream(const U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1, u2);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    stream(U0& u0)
+    {
+        open_impl(detail::forward<Device, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    stream(U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    stream(U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1, u2);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0>
+    void open(const U0& u0)
+    {
+        open_impl(detail::forward<Device, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    void open(const U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    void open(const U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1, u2);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    void open(U0& u0)
+    {
+        open_impl(detail::forward<Device, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    void open(U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    void open(U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<Device, U0>(), u0, u1, u2);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    bool is_open() const { return this->member.is_open(); }
+    void close() { this->member.close(); }
+    bool auto_close() const { return this->member.auto_close(); }
+    void set_auto_close(bool close) { this->member.set_auto_close(close); }
+    bool strict_sync() { return this->member.strict_sync(); }
+    Device& operator*() { return *this->member; }
+    Device* operator->() { return &*this->member; }
+private:
+    template<typename U0>
+    void open_impl(mpl::false_, const U0& u0)
+    {
+        this->clear(); 
+        this->member.open(u0);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    void open_impl(mpl::false_, U0& u0)
+    {
+        this->clear(); 
+        this->member.open(detail::wrap(u0));
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0>
+    void open_impl(mpl::true_, const U0& u0)
+    {
+        this->clear(); 
+        this->member.open(Device(const_cast<U0&>(u0)));
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    void open_impl(mpl::true_, U0& u0)
+    {
+        this->clear(); 
+        this->member.open(Device(u0));
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0, typename U1>
+    void open_impl(mpl::false_, const U0& u0, const U1& u1)
+    {
+        this->clear(); 
+        this->member.open(u0, u1);
+    }
+    template<typename U0, typename U1>
+    void open_impl(mpl::true_, const U0& u0, const U1& u1)
+    {
+        this->clear(); 
+        this->member.open(Device(const_cast<U0&>(u0), u1));
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0, typename U1>
+    void open_impl(mpl::true_, U0& u0, const U1& u1)
+    {
+        this->clear(); 
+        this->member.open(Device(u0, u1));
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0, typename U1, typename U2>
+    void open_impl(mpl::false_, const U0& u0, const U1& u1, const U2& u2)
+    {
+        this->clear(); 
+        this->member.open(u0, u1, u2);
+    }
+    template<typename U0, typename U1, typename U2>
+    void open_impl(mpl::true_, const U0& u0, const U1& u1, const U2& u2)
+    {
+        this->clear(); 
+        this->member.open(Device(const_cast<U0&>(u0), u1, u2));
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0, typename U1, typename U2>
+    void open_impl(mpl::true_, U0& u0, const U1& u1, const U2& u2)
+    {
+        this->clear(); 
+        this->member.open(Device(u0, u1, u2));
+    }
+#endif
+};
+
+} } // End namespaces iostreams, boost.
+
+#endif NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp b/include/ndnboost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp
new file mode 100644
index 0000000..149c1cb
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp
@@ -0,0 +1,189 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_BUFFER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_BUFFER_HPP_INCLUDED
+
+#include <ndnboost/iostreams/detail/broken_overload_resolution/forward.hpp>
+#include <ndnboost/throw_exception.hpp>
+
+namespace ndnboost { namespace iostreams {
+
+template< typename T, 
+          typename Tr = 
+              NDNBOOST_IOSTREAMS_CHAR_TRAITS(
+                  NDNBOOST_DEDUCED_TYPENAME char_type_of<T>::type 
+              ),
+          typename Alloc = 
+              std::allocator<
+                  NDNBOOST_DEDUCED_TYPENAME char_type_of<T>::type 
+              >,
+          typename Mode = NDNBOOST_DEDUCED_TYPENAME mode_of<T>::type >
+class stream_buffer
+    : public detail::stream_buffer_traits<T, Tr, Alloc, Mode>::type
+{
+private:
+    NDNBOOST_STATIC_ASSERT((
+        is_convertible<
+            NDNBOOST_DEDUCED_TYPENAME iostreams::category_of<T>::type, Mode
+        >::value
+    ));
+    typedef typename 
+            detail::stream_buffer_traits<
+                T, Tr, Alloc, Mode
+            >::type                           base_type;
+public:
+    typedef typename char_type_of<T>::type    char_type;
+    struct category 
+        : Mode,
+          closable_tag,
+          streambuf_tag
+        { };
+    NDNBOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr)
+    stream_buffer() { }
+    ~stream_buffer()
+    { 
+        try { 
+            if (this->is_open() && this->auto_close()) 
+                this->close(); 
+        } catch (...) { } 
+    }
+    template<typename U0>
+    stream_buffer(const U0& u0)
+    {
+        open_impl(detail::forward<T, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    stream_buffer(const U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    stream_buffer(const U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1, u2);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    stream_buffer(U0& u0)
+    {
+        open_impl(detail::forward<T, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    stream_buffer(U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    stream_buffer(U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1, u2);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0>
+    void open(const U0& u0)
+    {
+        open_impl(detail::forward<T, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    void open(const U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    void open(const U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1, u2);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    void open(U0& u0)
+    {
+        open_impl(detail::forward<T, U0>(), u0);
+    }
+    template<typename U0, typename U1>
+    void open(U0& u0, const U1& u1)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1);
+    }
+    template<typename U0, typename U1, typename U2>
+    void open(U0& u0, const U1& u1, const U2& u2)
+    {
+        open_impl(detail::forward<T, U0>(), u0, u1, u2);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    T& operator*() { return *this->component(); }
+    T* operator->() { return this->component(); }
+private:
+    template<typename U0>
+    void open_impl(mpl::false_, const U0& u0)
+    {
+        base_type::open(const_cast<U0&>(u0), -1, -1);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    void open_impl(mpl::false_, U0& u0)
+    {
+        base_type::open(detail::wrap(u0), -1, -1);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0>
+    void open_impl(mpl::true_, const U0& u0)
+    {
+        base_type::open(T(const_cast<U0&>(u0)), -1, -1);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0>
+    void open_impl(mpl::true_, U0& u0)
+    {
+        base_type::open(T(u0), -1, -1);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0, typename U1>
+    void open_impl(mpl::false_, const U0& u0, const U1& u1)
+    {
+        base_type::open(u0, u1, -1);
+    }
+    template<typename U0, typename U1>
+    void open_impl(mpl::true_, const U0& u0, const U1& u1)
+    {
+        base_type::open(T(const_cast<U0&>(u0), u1), -1, -1);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0, typename U1>
+    void open_impl(mpl::true_, U0& u0, const U1& u1)
+    {
+        base_type::open(T(u0, u1), -1, -1);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    template<typename U0, typename U1, typename U2>
+    void open_impl(mpl::false_, const U0& u0, const U1& u1, const U2& u2)
+    {
+        base_type::open(u0, u1, u2);
+    }
+    template<typename U0, typename U1, typename U2>
+    void open_impl(mpl::true_, const U0& u0, const U1& u1, const U2& u2)
+    {
+        base_type::open(T(const_cast<U0&>(u0), u1, u2), -1, -1);
+    }
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+    template<typename U0, typename U1, typename U2>
+    void open_impl(mpl::true_, U0& u0, const U1& u1, const U2& u2)
+    {
+        base_type::open(T(u0, u1, u2), -1, -1);
+    }
+#endif // !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------//
+    void check_open()
+    {
+        if (this->is_open()) 
+            ndnboost::throw_exception(NDNBOOST_IOSTREAMS_FAILURE("already open"));
+    }
+};
+
+} } // End namespaces iostreams, boost.
+
+#endif // NDNBOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_BUFFER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/buffer.hpp b/include/ndnboost/iostreams/detail/buffer.hpp
new file mode 100644
index 0000000..beb5f6c
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/buffer.hpp
@@ -0,0 +1,200 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_BUFFERS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_BUFFERS_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <algorithm>                           // swap.
+#include <memory>                              // allocator.
+#include <ndnboost/config.hpp>                    // member templates.
+#include <ndnboost/iostreams/char_traits.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>      // streamsize.
+#include <ndnboost/iostreams/read.hpp>
+#include <ndnboost/iostreams/traits.hpp>          // int_type_of.
+#include <ndnboost/iostreams/checked_operations.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+//----------------Buffers-----------------------------------------------------//
+
+//
+// Template name: buffer
+// Description: Character buffer.
+// Template parameters:
+//     Ch - The character type.
+//     Alloc - The Allocator type.
+//
+template< typename Ch,
+          typename Alloc = std::allocator<Ch> >
+class basic_buffer {
+private:
+#ifndef NDNBOOST_NO_STD_ALLOCATOR
+    typedef typename Alloc::template rebind<Ch>::other allocator_type;
+#else
+    typedef std::allocator<Ch> allocator_type;
+#endif
+public:
+    basic_buffer();
+    basic_buffer(int buffer_size);
+    ~basic_buffer();
+    void resize(int buffer_size);
+    Ch* begin() const { return buf_; }
+    Ch* end() const { return buf_ + size_; }
+    Ch* data() const { return buf_; }
+    std::streamsize size() const { return size_; }
+    void swap(basic_buffer& rhs);
+private:
+    // Disallow copying and assignment.
+    basic_buffer(const basic_buffer&);
+    basic_buffer& operator=(const basic_buffer&);
+    Ch*              buf_;
+    std::streamsize  size_;
+};
+
+template<typename Ch, typename Alloc>
+void swap(basic_buffer<Ch, Alloc>& lhs, basic_buffer<Ch, Alloc>& rhs)
+{ lhs.swap(rhs); }
+
+//
+// Template name: buffer
+// Description: Character buffer with two pointers accessible via ptr() and
+//      eptr().
+// Template parameters:
+//     Ch - A character type.
+//
+template< typename Ch,
+          typename Alloc = std::allocator<Ch> >
+class buffer : public basic_buffer<Ch, Alloc> {
+private:
+    typedef basic_buffer<Ch, Alloc> base;
+public:
+    typedef iostreams::char_traits<Ch> traits_type;
+    using base::resize; 
+    using base::data; 
+    using base::size;
+    typedef Ch* const const_pointer;
+    buffer(int buffer_size);
+    Ch* & ptr() { return ptr_; }
+    const_pointer& ptr() const { return ptr_; }
+    Ch* & eptr() { return eptr_; }
+    const_pointer& eptr() const { return eptr_; }
+    void set(std::streamsize ptr, std::streamsize end);
+    void swap(buffer& rhs);
+
+    // Returns an int_type as a status code.
+    template<typename Source>
+    typename int_type_of<Source>::type fill(Source& src) 
+    {
+        using namespace std;
+        std::streamsize keep;
+        if ((keep = static_cast<std::streamsize>(eptr_ - ptr_)) > 0)
+            traits_type::move(this->data(), ptr_, keep);
+        set(0, keep);
+        std::streamsize result = 
+            iostreams::read(src, this->data() + keep, this->size() - keep);
+        if (result != -1)
+            this->set(0, keep + result);
+        return result == -1 ?
+            traits_type::eof() :
+                result == 0 ?
+                    traits_type::would_block() :
+                    traits_type::good();
+
+    }
+
+    // Returns true if one or more characters were written.
+    template<typename Sink>
+    bool flush(Sink& dest) 
+    {
+        using namespace std;
+        std::streamsize amt = static_cast<std::streamsize>(eptr_ - ptr_);
+        std::streamsize result = iostreams::write_if(dest, ptr_, amt);
+        if (result < amt) {
+            traits_type::move( this->data(), 
+                               ptr_ + result, 
+                               amt - result );
+        }
+        this->set(0, amt - result);
+        return result != 0;
+    }
+private:
+    Ch *ptr_, *eptr_;
+};
+
+template<typename Ch, typename Alloc>
+void swap(buffer<Ch, Alloc>& lhs, buffer<Ch, Alloc>& rhs)
+{ lhs.swap(rhs); }
+
+//--------------Implementation of basic_buffer--------------------------------//
+
+template<typename Ch, typename Alloc>
+basic_buffer<Ch, Alloc>::basic_buffer() : buf_(0), size_(0) { }
+
+template<typename Ch, typename Alloc>
+basic_buffer<Ch, Alloc>::basic_buffer(int buffer_size)
+    : buf_(static_cast<Ch*>(allocator_type().allocate(buffer_size, 0))), 
+      size_(buffer_size) // Cast for SunPro 5.3.
+    { }
+
+template<typename Ch, typename Alloc>
+inline basic_buffer<Ch, Alloc>::~basic_buffer()
+{
+    if (buf_) {
+        allocator_type().deallocate(buf_,
+            static_cast<NDNBOOST_DEDUCED_TYPENAME Alloc::size_type>(size_));
+    }
+}
+
+template<typename Ch, typename Alloc>
+inline void basic_buffer<Ch, Alloc>::resize(int buffer_size)
+{
+    if (size_ != buffer_size) {
+        basic_buffer<Ch, Alloc> temp(buffer_size);
+        std::swap(size_, temp.size_);
+        std::swap(buf_, temp.buf_);
+    }
+}
+
+template<typename Ch, typename Alloc>
+void basic_buffer<Ch, Alloc>::swap(basic_buffer& rhs) 
+{ 
+    std::swap(buf_, rhs.buf_); 
+    std::swap(size_, rhs.size_); 
+}
+
+//--------------Implementation of buffer--------------------------------------//
+
+template<typename Ch, typename Alloc>
+buffer<Ch, Alloc>::buffer(int buffer_size)
+    : basic_buffer<Ch, Alloc>(buffer_size) { }
+
+template<typename Ch, typename Alloc>
+inline void buffer<Ch, Alloc>::set(std::streamsize ptr, std::streamsize end)
+{ 
+    ptr_ = data() + ptr; 
+    eptr_ = data() + end; 
+}
+
+template<typename Ch, typename Alloc>
+inline void buffer<Ch, Alloc>::swap(buffer& rhs) 
+{ 
+    base::swap(rhs); 
+    std::swap(ptr_, rhs.ptr_); 
+    std::swap(eptr_, rhs.eptr_); 
+}
+
+//----------------------------------------------------------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_BUFFERS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/call_traits.hpp b/include/ndnboost/iostreams/detail/call_traits.hpp
new file mode 100644
index 0000000..c917c1a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/call_traits.hpp
@@ -0,0 +1,32 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_VALUE_TYPE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_VALUE_TYPE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/mpl/if.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename T>
+struct param_type {
+    typedef typename mpl::if_<is_std_io<T>, T&, const T&>::type type;
+};
+
+template<typename T>
+struct value_type {
+    typedef typename mpl::if_<is_std_io<T>, T&, T>::type type;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_VALUE_TYPE_HPP_INCLUDED //-----------//
diff --git a/include/ndnboost/iostreams/detail/char_traits.hpp b/include/ndnboost/iostreams/detail/char_traits.hpp
new file mode 100644
index 0000000..97aaf28
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/char_traits.hpp
@@ -0,0 +1,63 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// Provides std::char_traits for libraries without templated streams. Should not
+// be confused with <ndnboost/iostreams/char_traits.hpp>, which defines the
+// template ndnboost::iostreams::char_traits.
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CHAR_TRAITS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CHAR_TRAITS_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <iosfwd>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#ifdef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# include <ndnboost/config.hpp> // Make sure size_t is in std.
+# include <cstddef>
+# include <cstring>
+# include <cstdio>
+#endif
+
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------------------//
+# define NDNBOOST_IOSTREAMS_CHAR_TRAITS(ch) std::char_traits< ch >
+#else
+# define NDNBOOST_IOSTREAMS_CHAR_TRAITS(ch) ndnboost::iostreams::detail::char_traits
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+struct char_traits  {
+    typedef char            char_type;
+    typedef int             int_type;
+    typedef std::streampos  pos_type;
+    typedef std::streamoff  off_type;
+
+    // Note: this may not be not conforming, since it treats chars as unsigned,
+    // but is only used to test for equality.
+    static int compare(const char* lhs, const char* rhs, std::size_t n)
+    { return std::strncmp(lhs, rhs, n); }
+    static char* copy(char *dest, const char *src, std::size_t n)
+    { return static_cast<char*>(std::memcpy(dest, src, n)); }
+    static char* move(char *dest, const char *src, std::size_t n)
+    { return static_cast<char*>(std::memmove(dest, src, n)); }
+    static const char* find(const char* s, std::size_t n, const char& c)
+    { return (const char*) (const void*) std::memchr(s, c, n); }
+    static char to_char_type(const int& c) { return c; }
+    static int to_int_type(const char& c) { return c; }
+    static bool eq_int_type(const int& lhs, const int& rhs)
+    { return lhs == rhs; }
+    static int eof() { return EOF; }
+    static int not_eof(const int& c) { return c != EOF ? c : '\n'; }
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifdef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-----------------------//
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CHAR_TRAITS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/codecvt_helper.hpp b/include/ndnboost/iostreams/detail/codecvt_helper.hpp
new file mode 100644
index 0000000..4b1a1c4
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/codecvt_helper.hpp
@@ -0,0 +1,237 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Contains the definition of the template codecvt_helper, useful for
+// defining specializations of std::codecvt where state_type != mbstate_t.
+// Compensates for the fact that some standard library implementations 
+// do not derive the primiary codecvt template from locale::facet or 
+// provide the correct member types and functions.
+
+// Usage: 
+//
+// // In global namespace:
+// NDNBOOST_IOSTREAMS_CODECVT_SPEC(mystate)
+//
+// // In user namespace:
+// template<typename Intern, typename Extern>
+// struct mycodecvt : codecvt_helper<Intern, Extern, State> { ... };
+//
+// // Or:
+// struct mycodecvt : codecvt_helper<wchar_t, char, State> { ... };
+// 
+// Etc.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CODECVT_HELPER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CODECVT_HELPER_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/config.hpp>  // Put size_t in std, NDNBOOST_MSVC, Dinkum.
+#include <ndnboost/detail/workaround.hpp>
+#include <algorithm>         // min.
+#include <cstddef>           // size_t.
+#include <locale>            // locale, codecvt_base, codecvt.
+#include <ndnboost/iostreams/detail/config/codecvt.hpp>
+
+//------------------Definition of traits--------------------------------------//
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+#if !NDNBOOST_WORKAROUND(NDNBOOST_DINKUMWARE_STDLIB, == 1) //-----------------------//
+
+template<typename T>
+struct codecvt_intern { typedef typename T::intern_type type; };
+
+template<typename T>
+struct codecvt_extern { typedef typename T::extern_type type; };
+
+#else // #if !NDNBOOST_WORKAROUND(NDNBOOST_DINKUMWARE_STDLIB, == 1) //--------------//
+
+template<typename T>
+struct codecvt_intern { typedef typename T::from_type type; };
+
+template<typename T>
+struct codecvt_extern { typedef typename T::to_type type; };
+
+#endif // #if !NDNBOOST_WORKAROUND(NDNBOOST_DINKUMWARE_STDLIB, == 1) //-------------//
+
+template<typename T>
+struct codecvt_state { typedef typename T::state_type type; };
+
+} } } // End namespaces detail, iostreams, boost.
+
+//------------------Definition of codecvt_impl--------------------------------//
+
+#if defined(NDNBOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION) || \
+    defined(NDNBOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION) || \
+    defined(NDNBOOST_IOSTREAMS_NO_LOCALE) \
+    /**/
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Intern, typename Extern, typename State>
+struct codecvt_impl : std::locale::facet, std::codecvt_base {
+public:
+    typedef Intern  intern_type;
+    typedef Extern  extern_type;
+    typedef State   state_type;
+
+    codecvt_impl(std::size_t refs = 0) : std::locale::facet(refs) { } 
+
+    std::codecvt_base::result
+    in( State& state, const Extern* first1, const Extern* last1,
+        const Extern*& next1, Intern* first2, Intern* last2,
+        Intern*& next2 ) const
+    {
+        return do_in(state, first1, last1, next1, first2, last2, next2);
+    }
+
+    std::codecvt_base::result
+    out( State& state, const Intern* first1, const Intern* last1,
+         const Intern*& next1, Extern* first2, Extern* last2,
+         Extern*& next2 ) const
+    {
+        return do_out(state, first1, last1, next1, first2, last2, next2);
+    }
+
+    std::codecvt_base::result
+    unshift(State& state, Extern* first2, Extern* last2, Extern*& next2) const
+    {
+        return do_unshift(state, first2, last2, next2);
+    }
+
+    bool always_noconv() const throw() { return do_always_noconv(); }
+
+    int max_length() const throw() { return do_max_length(); }
+
+    int encoding() const throw() { return do_encoding(); }
+
+    int length( NDNBOOST_IOSTREAMS_CODECVT_CV_QUALIFIER State& state, 
+                const Extern* first1, const Extern* last1,
+                std::size_t len2 ) const throw()
+    {
+        return do_length(state, first1, last1, len2);
+    }
+protected:
+    std::codecvt_base::result
+    virtual do_in( State&, const Extern*, const Extern*, const Extern*&, 
+                   Intern*, Intern*, Intern*& ) const
+    {
+        return std::codecvt_base::noconv;
+    }
+
+    std::codecvt_base::result
+    virtual do_out( State&, const Intern*, const Intern*, const Intern*&, 
+                    Extern*, Extern*, Extern*& ) const
+    {
+        return std::codecvt_base::noconv;
+    }
+
+    std::codecvt_base::result
+    virtual do_unshift(State&, Extern*, Extern*, Extern*&) const
+    {
+        return std::codecvt_base::ok;
+    }
+
+    virtual bool do_always_noconv() const throw() { return true; }
+
+    virtual int do_max_length() const throw() { return 1; }
+
+    virtual int do_encoding() const throw() { return 1; }
+
+    virtual int do_length( NDNBOOST_IOSTREAMS_CODECVT_CV_QUALIFIER State&, 
+                           const Extern* first1, const Extern* last1,
+                           std::size_t len2 ) const throw()
+    {
+        return (std::min)(static_cast<std::size_t>(last1 - first1), len2);
+    }
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // no primary codecvt definition, empty definition.
+
+//------------------Definition of NDNBOOST_IOSTREAMS_CODECVT_SPEC----------------//
+
+#if defined(NDNBOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION) || \
+    defined(NDNBOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION) \
+    /**/
+# ifndef NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#  define NDNBOOST_IOSTREAMS_CODECVT_SPEC(state) \
+    namespace std { \
+        template<typename Intern, typename Extern> \
+        class codecvt<Intern, Extern, state> \
+            : public ::ndnboost::iostreams::detail::codecvt_impl< \
+                         Intern, Extern, state \
+                     > \
+        { \
+        public: \
+            codecvt(std::size_t refs = 0) \
+                : ::ndnboost::iostreams::detail::codecvt_impl< \
+                      Intern, Extern, state \
+                  >(refs) \
+                { } \
+            static std::locale::id id; \
+        }; \
+        template<typename Intern, typename Extern> \
+        std::locale::id codecvt<Intern, Extern, state>::id; \
+    } \
+    /**/
+# else
+#  define NDNBOOST_IOSTREAMS_CODECVT_SPEC(state) \
+    namespace std { \
+        template<> \
+        class codecvt<wchar_t, char, state> \
+            : public ::ndnboost::iostreams::detail::codecvt_impl< \
+                         wchar_t, char, state \
+                     > \
+        { \
+        public: \
+            codecvt(std::size_t refs = 0) \
+                : ::ndnboost::iostreams::detail::codecvt_impl< \
+                      wchar_t, char, state \
+                  >(refs) \
+                { } \
+            static std::locale::id id; \
+        }; \
+        template<> \
+        std::locale::id codecvt<wchar_t, char, state>::id; \
+    } \
+    /**/
+# endif
+#else
+# define NDNBOOST_IOSTREAMS_CODECVT_SPEC(state)
+#endif // no primary codecvt definition, or empty definition.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+                    
+//------------------Definition of codecvt_helper------------------------------//
+
+template<typename Intern, typename Extern, typename State>
+struct codecvt_helper : std::codecvt<Intern, Extern, State> { 
+    typedef Intern  intern_type;
+    typedef Extern  extern_type;
+    typedef State   state_type;
+    codecvt_helper(std::size_t refs = 0) 
+    #if !defined(NDNBOOST_IOSTREAMS_NO_CODECVT_CTOR_FROM_SIZE_T)
+        : std::codecvt<Intern, Extern, State>(refs)
+    #else
+        : std::codecvt<Intern, Extern, State>()
+    #endif
+        { }
+#ifdef NDNBOOST_IOSTREAMS_NO_CODECVT_MAX_LENGTH
+    int max_length() const throw() { return do_max_length(); }
+protected:
+    virtual int do_max_length() const throw() { return 1; }
+#endif
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CODECVT_HELPER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/codecvt_holder.hpp b/include/ndnboost/iostreams/detail/codecvt_holder.hpp
new file mode 100644
index 0000000..7b5e929
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/codecvt_holder.hpp
@@ -0,0 +1,63 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Contains machinery for performing code conversion.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CODECVT_HOLDER_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CODECVT_HOLDER_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <cwchar>            // mbstate_t.
+#include <locale>            // codecvt, locale.
+#include <ndnboost/config.hpp>  // HAS_MACRO_USE_FACET.
+#include <ndnboost/iostreams/detail/config/codecvt.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+struct default_codecvt { 
+    typedef wchar_t         intern_type, from_type;
+    typedef char            extern_type, to_type;
+    typedef std::mbstate_t  state_type;
+};
+
+template<typename Codecvt>
+struct codecvt_holder {
+    typedef Codecvt codecvt_type;
+    const codecvt_type& get() const { return codecvt_; }
+    void imbue(const std::locale&) { }
+    Codecvt codecvt_;
+};
+
+template<>
+struct codecvt_holder<default_codecvt> {
+    typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type;
+    codecvt_holder() { reset_codecvt(); }
+    const codecvt_type& get() const { return *codecvt_; }
+    void imbue(const std::locale& loc) 
+    { 
+        loc_ = loc;
+        reset_codecvt();
+    }
+    void reset_codecvt()
+    {
+        using namespace std;
+        #ifndef NDNBOOST_HAS_MACRO_USE_FACET
+            codecvt_ = & use_facet< codecvt_type >(loc_);
+        #else
+            codecvt_ = & _USE(loc_, codecvt_type);
+        #endif
+    }
+    std::locale loc_; // Prevent codecvt_ from being freed.
+    const codecvt_type* codecvt_;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CODECVT_HOLDER_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/auto_link.hpp b/include/ndnboost/iostreams/detail/config/auto_link.hpp
new file mode 100644
index 0000000..da9f805
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/auto_link.hpp
@@ -0,0 +1,49 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from <ndnboost/config/auto_link.hpp> and from
+// http://www.boost.org/more/separate_compilation.html, by John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_AUTO_LINK_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_AUTO_LINK_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#if defined(NDNBOOST_EXTERNAL_LIB_NAME)
+# if defined(NDNBOOST_MSVC) \
+     || defined(__BORLANDC__) \
+     || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
+     || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) \
+     /**/
+#  pragma comment(lib, NDNBOOST_EXTERNAL_LIB_NAME)
+# endif
+# undef NDNBOOST_EXTERNAL_LIB_NAME
+#endif
+
+//------------------Enable automatic library variant selection----------------// 
+
+#if !defined(NDNBOOST_IOSTREAMS_SOURCE) && \
+    !defined(NDNBOOST_ALL_NO_LIB) && \
+    !defined(NDNBOOST_IOSTREAMS_NO_LIB) \
+    /**/
+
+// Set the name of our library, this will get undef'ed by auto_link.hpp
+// once it's done with it.
+# define NDNBOOST_LIB_NAME ndnboost_iostreams
+
+// If we're importing code from a dll, then tell auto_link.hpp about it.
+# if defined(NDNBOOST_ALL_DYN_LINK) || defined(NDNBOOST_IOSTREAMS_DYN_LINK)
+#  define NDNBOOST_DYN_LINK
+# endif
+
+// And include the header that does the work.
+# include <ndnboost/config/auto_link.hpp>
+#endif  // auto-linking disabled
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_AUTO_LINK_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/bzip2.hpp b/include/ndnboost/iostreams/detail/config/bzip2.hpp
new file mode 100644
index 0000000..c62ca61
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/bzip2.hpp
@@ -0,0 +1,48 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from <ndnboost/config/auto_link.hpp> and from
+// http://www.boost.org/more/separate_compilation.html, by John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_BZIP2_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_BZIP2_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#if defined(NDNBOOST_BZIP2_BINARY)
+# if defined(NDNBOOST_MSVC) || \
+     defined(__BORLANDC__) || \
+     (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) || \
+     (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) \
+     /**/
+
+// Specify the name of the .lib file.
+#  pragma comment(lib, NDNBOOST_STRINGIZE(NDNBOOST_BZIP2_BINARY))
+# endif
+#else 
+# if !defined(NDNBOOST_IOSTREAMS_SOURCE) && \
+     !defined(NDNBOOST_ALL_NO_LIB) && \
+     !defined(NDNBOOST_IOSTREAMS_NO_LIB) \
+     /**/
+
+// Set the name of our library, this will get undef'ed by auto_link.hpp
+// once it's done with it.
+#  define NDNBOOST_LIB_NAME ndnboost_bzip2
+
+// If we're importing code from a dll, then tell auto_link.hpp about it.
+#  if defined(NDNBOOST_ALL_DYN_LINK) || defined(NDNBOOST_IOSTREAMS_DYN_LINK)
+#   define NDNBOOST_DYN_LINK
+#  endif
+
+// And include the header that does the work.
+#  include <ndnboost/config/auto_link.hpp>
+# endif
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_BZIP2_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/codecvt.hpp b/include/ndnboost/iostreams/detail/config/codecvt.hpp
new file mode 100644
index 0000000..afa45b2
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/codecvt.hpp
@@ -0,0 +1,80 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#include <cstddef>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif       
+
+//------------------Support for codecvt with user-defined state types---------//
+
+#if defined(__MSL_CPP__) || defined(__LIBCOMO__) || \
+    NDNBOOST_WORKAROUND(_STLPORT_VERSION, <= 0x450) \
+    /**/
+# define NDNBOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION
+#endif
+
+#if defined(__GLIBCPP__) || defined(__GLIBCXX__) || \
+    NDNBOOST_WORKAROUND(_STLPORT_VERSION, > 0x450) \
+    /**/
+# define NDNBOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION
+#endif
+
+//------------------Check for codecvt ctor taking a reference count-----------//
+
+#if NDNBOOST_WORKAROUND(__MWERKS__, NDNBOOST_TESTED_AT(0x3205)) || \
+    NDNBOOST_WORKAROUND(_STLPORT_VERSION, < 0x461) \
+    /**/
+# define NDNBOOST_IOSTREAMS_NO_CODECVT_CTOR_FROM_SIZE_T
+#endif
+
+//------------------Normalize codecvt::length---------------------------------//
+
+#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) && \
+    (!defined(NDNBOOST_RWSTD_VER) || NDNBOOST_RWSTD_VER < 0x04010300) && \
+    (!defined(__MACH__) || !defined(__INTEL_COMPILER))
+    /**/
+# define NDNBOOST_IOSTREAMS_CODECVT_CV_QUALIFIER const
+#else
+# define NDNBOOST_IOSTREAMS_CODECVT_CV_QUALIFIER
+#endif
+
+//------------------Check for codecvt::max_length-----------------------------//
+
+#if NDNBOOST_WORKAROUND(_STLPORT_VERSION, < 0x461)
+# define NDNBOOST_IOSTREAMS_NO_CODECVT_MAX_LENGTH
+#endif
+                    
+//------------------Put mbstate_t and codecvt in std--------------------------//
+
+#ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+# include <locale>
+#endif
+
+// From Robert Ramey's version of utf8_codecvt_facet.
+namespace std { 
+
+#if defined(__LIBCOMO__)
+    using ::mbstate_t;
+#elif defined(NDNBOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
+    using ::mbstate_t;
+#elif defined(__SGI_STL_PORT)
+#elif defined(NDNBOOST_NO_STDC_NAMESPACE)
+    using ::codecvt;
+    using ::mbstate_t;
+#endif
+
+} // End namespace std.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_CODECVT_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/disable_warnings.hpp b/include/ndnboost/iostreams/detail/config/disable_warnings.hpp
new file mode 100644
index 0000000..0f65f00
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/disable_warnings.hpp
@@ -0,0 +1,30 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#include <ndnboost/config.hpp>             // NDNBOOST_MSVC.
+#include <ndnboost/detail/workaround.hpp>  // NDNBOOST_WORKAROUND.
+
+#if defined(NDNBOOST_MSVC)
+# pragma warning(push)
+# pragma warning(disable:4127)    // Conditional expression is constant.
+# pragma warning(disable:4130)    // Logical operation on address of string constant.
+# pragma warning(disable:4224)    // Parameter previously defined as type.
+# pragma warning(disable:4244)    // Conversion: possible loss of data.
+# pragma warning(disable:4512)    // Assignment operator could not be generated.
+# pragma warning(disable:4706)    // Assignment within conditional expression.
+# if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, >= 1400)
+#  pragma warning(disable:6334)   // sizeof applied to an expression with an operator.
+# endif
+#else
+# if NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600)
+#  pragma warn -8008     // Condition always true/false.
+#  pragma warn -8066     // Unreachable code.
+#  pragma warn -8071     // Conversion may lose significant digits.
+#  pragma warn -8072     // Suspicious pointer arithmetic.
+#  pragma warn -8080     // identifier declared but never used.
+# endif
+#endif
diff --git a/include/ndnboost/iostreams/detail/config/dyn_link.hpp b/include/ndnboost/iostreams/detail/config/dyn_link.hpp
new file mode 100644
index 0000000..e8d922f
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/dyn_link.hpp
@@ -0,0 +1,37 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from http://www.boost.org/more/separate_compilation.html, by
+// John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_DYN_LINK_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_DYN_LINK_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+//------------------Enable dynamic linking on windows-------------------------// 
+
+#ifdef NDNBOOST_HAS_DECLSPEC 
+# if defined(NDNBOOST_ALL_DYN_LINK) || defined(NDNBOOST_IOSTREAMS_DYN_LINK)
+#  ifdef NDNBOOST_IOSTREAMS_SOURCE
+#   define NDNBOOST_IOSTREAMS_DECL __declspec(dllexport)
+#  else
+#   define NDNBOOST_IOSTREAMS_DECL __declspec(dllimport)
+#  endif  
+# endif  
+#endif 
+
+#ifndef NDNBOOST_IOSTREAMS_DECL
+# define NDNBOOST_IOSTREAMS_DECL
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_DYN_LINK_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/enable_warnings.hpp b/include/ndnboost/iostreams/detail/config/enable_warnings.hpp
new file mode 100644
index 0000000..3043c5e
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/enable_warnings.hpp
@@ -0,0 +1,18 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#if defined(NDNBOOST_MSVC)
+# pragma warning(pop)
+#else
+# if NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600)
+#  pragma warn .8008     // Condition always true/false.
+#  pragma warn .8066     // Unreachable code.
+#  pragma warn .8071     // Conversion may lose significant digits.
+#  pragma warn .8072     // Suspicious pointer arithmetic.
+#  pragma warn .8080     // identifier declared but never used.
+# endif
+#endif
diff --git a/include/ndnboost/iostreams/detail/config/fpos.hpp b/include/ndnboost/iostreams/detail/config/fpos.hpp
new file mode 100644
index 0000000..ffb9656
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/fpos.hpp
@@ -0,0 +1,31 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+
+ * File:        ndnboost/iostreams/detail/execute.hpp
+ * Date:        Thu Dec 06 13:21:54 MST 2007
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Defines the preprocessor symbol NDNBOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS for
+ * platforms that use the implementation of std::fpos from the Dinkumware 
+ * Standard Library.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_FPOS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_FPOS_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+# if (defined(_YVALS) || defined(_CPPLIB_VER)) && !defined(__SGI_STL_PORT) && \
+     !defined(_STLPORT_VERSION) && !defined(__QNX__)
+     /**/
+#  define NDNBOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
+# endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_FPOS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/gcc.hpp b/include/ndnboost/iostreams/detail/config/gcc.hpp
new file mode 100644
index 0000000..2685346
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/gcc.hpp
@@ -0,0 +1,27 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from <ndnboost/config/auto_link.hpp> and from
+// http://www.boost.org/more/separate_compilation.html, by John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_GCC_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_GCC_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp> // NDNBOOST_INTEL.
+
+#if defined(__GNUC__) && !defined(NDNBOOST_INTEL)
+# define NDNBOOST_IOSTREAMS_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
+# define NDNBOOST_IOSTREAMS_GCC_WORKAROUND_GUARD 1
+#else
+# define NDNBOOST_IOSTREAMS_GCC_WORKAROUND_GUARD 0
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_GCC_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/limits.hpp b/include/ndnboost/iostreams/detail/config/limits.hpp
new file mode 100644
index 0000000..cc83aec
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/limits.hpp
@@ -0,0 +1,19 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_LIMITS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_LIMITS_HPP_INCLUDED
+
+#ifndef NDNBOOST_IOSTREAMS_MAX_FORWARDING_ARITY
+# define NDNBOOST_IOSTREAMS_MAX_FORWARDING_ARITY 3
+#endif
+
+#ifndef NDNBOOST_IOSTREAMS_MAX_EXECUTE_ARITY
+# define NDNBOOST_IOSTREAMS_MAX_EXECUTE_ARITY 5
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_LIMITS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/overload_resolution.hpp b/include/ndnboost/iostreams/detail/config/overload_resolution.hpp
new file mode 100644
index 0000000..2f35c41
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/overload_resolution.hpp
@@ -0,0 +1,32 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from <ndnboost/config/auto_link.hpp> and from
+// http://www.boost.org/more/separate_compilation.html, by John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_BROKEN_OVERLOAD_RESOLUTION_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_BROKEN_OVERLOAD_RESOLUTION_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif             
+
+#include <ndnboost/config.hpp> // NDNBOOST_MSVC.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/config/gcc.hpp>
+
+#if !defined(NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION)
+# if NDNBOOST_WORKAROUND(__MWERKS__, <= 0x3003) || \
+     NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600) || \
+     NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) || \
+     NDNBOOST_WORKAROUND(NDNBOOST_IOSTREAMS_GCC, <= 295) \
+     /**/
+#  define NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION
+# endif
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_BROKEN_OVERLOAD_RESOLUTION_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/rtl.hpp b/include/ndnboost/iostreams/detail/config/rtl.hpp
new file mode 100644
index 0000000..c39b814
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/rtl.hpp
@@ -0,0 +1,72 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+ *
+ * Defines preprocessor symbols expanding to the names of functions in the 
+ * C runtime library used to access file descriptors and to the type used
+ * to store file offsets for seeking.
+ * 
+ * File:        ndnboost/iostreams/detail/config/rtl.hpp
+ * Date:        Wed Dec 26 11:58:11 MST 2007
+ * 
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_RTL_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_RTL_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/iostreams/detail/config/windows_posix.hpp>
+
+// Handle open, close, read, and write
+#ifdef __BORLANDC__
+# define NDNBOOST_IOSTREAMS_RTL(x) NDNBOOST_JOIN(_rtl_, x)
+#elif defined NDNBOOST_IOSTREAMS_WINDOWS
+# define NDNBOOST_IOSTREAMS_RTL(x) NDNBOOST_JOIN(_, x)
+#else
+# define NDNBOOST_IOSTREAMS_RTL(x) ::x  // Distinguish from member function named x
+#endif
+#define NDNBOOST_IOSTREAMS_FD_OPEN   NDNBOOST_IOSTREAMS_RTL(open)
+#define NDNBOOST_IOSTREAMS_FD_CLOSE  NDNBOOST_IOSTREAMS_RTL(close)
+#define NDNBOOST_IOSTREAMS_FD_READ   NDNBOOST_IOSTREAMS_RTL(read)
+#define NDNBOOST_IOSTREAMS_FD_WRITE  NDNBOOST_IOSTREAMS_RTL(write)
+
+// Handle lseek, off_t, ftruncate, and stat
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+# if defined(NDNBOOST_MSVC) || defined(__MSVCRT__) // MSVC, MinGW
+#  define NDNBOOST_IOSTREAMS_FD_SEEK    _lseeki64
+#  define NDNBOOST_IOSTREAMS_FD_OFFSET  __int64
+# else                                          // Borland, Metrowerks, ...
+#  define NDNBOOST_IOSTREAMS_FD_SEEK    lseek  
+#  define NDNBOOST_IOSTREAMS_FD_OFFSET  long
+# endif
+#else // Non-windows
+# if defined(_LARGEFILE64_SOURCE) && !defined(__APPLE__) && \
+         (!defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64) || \
+     defined(_AIX) && !defined(_LARGE_FILES) || \
+     defined(NDNBOOST_IOSTREAMS_HAS_LARGE_FILE_EXTENSIONS)
+     /**/
+
+    /* Systems with transitional extensions for large file support */
+
+#  define NDNBOOST_IOSTREAMS_FD_SEEK      lseek64
+#  define NDNBOOST_IOSTREAMS_FD_TRUNCATE  ftruncate64
+#  define NDNBOOST_IOSTREAMS_FD_MMAP      mmap64
+#  define NDNBOOST_IOSTREAMS_FD_STAT      stat64
+#  define NDNBOOST_IOSTREAMS_FD_FSTAT     fstat64
+#  define NDNBOOST_IOSTREAMS_FD_OFFSET    off64_t
+# else
+#  define NDNBOOST_IOSTREAMS_FD_SEEK      lseek
+#  define NDNBOOST_IOSTREAMS_FD_TRUNCATE  ftruncate
+#  define NDNBOOST_IOSTREAMS_FD_MMAP      mmap
+#  define NDNBOOST_IOSTREAMS_FD_STAT      stat
+#  define NDNBOOST_IOSTREAMS_FD_FSTAT     fstat
+#  define NDNBOOST_IOSTREAMS_FD_OFFSET    off_t
+# endif
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_RTL_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/unreachable_return.hpp b/include/ndnboost/iostreams/detail/config/unreachable_return.hpp
new file mode 100644
index 0000000..1de856a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/unreachable_return.hpp
@@ -0,0 +1,25 @@
+// (C) Copyright 2010 Daniel James
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_UNREACHABLE_RETURN_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_UNREACHABLE_RETURN_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp>
+
+// If Boost.Exception has NDNBOOST_ATTRIBUTE_NORETURN
+#if defined(_MSC_VER) || defined(__GNUC__)
+#define NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(x) \
+    NDNBOOST_UNREACHABLE_RETURN(x)
+#else
+#define NDNBOOST_IOSTREAMS_UNREACHABLE_RETURN(x) \
+    return x;
+#endif
+
+#endif
diff --git a/include/ndnboost/iostreams/detail/config/wide_streams.hpp b/include/ndnboost/iostreams/detail/config/wide_streams.hpp
new file mode 100644
index 0000000..92ead3b
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/wide_streams.hpp
@@ -0,0 +1,55 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from http://www.boost.org/more/separate_compilation.html, by
+// John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_WIDE_STREAMS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_WIDE_STREAMS_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <cstddef>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif       
+
+//------------------Templated stream support----------------------------------//
+
+// From ndnboost/dynamic_bitset.hpp; thanks to Matthias Troyer for cray patch.
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# if defined(__STL_CONFIG_H) && \
+    !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \
+    /**/
+#  define NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# endif
+#endif // #ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+
+//------------------Wide stream support---------------------------------------//
+
+#ifndef NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS
+# if defined(NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES) || \
+     defined (NDNBOOST_NO_STD_WSTREAMBUF) && \
+     ( !defined(__MSL_CPP__) || defined(_MSL_NO_WCHART_CPP_SUPPORT) ) \
+     /**/
+#  define NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS
+# endif
+#endif // #ifndef NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS   
+
+//------------------Locale support--------------------------------------------//
+
+#ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+# if defined(NDNBOOST_NO_STD_LOCALE) || \
+     defined(__CYGWIN__) && \
+     ( !defined(__MSL_CPP__) || defined(_MSL_NO_WCHART_CPP_SUPPORT) ) \
+     /**/
+#  define NDNBOOST_IOSTREAMS_NO_LOCALE
+# endif
+#endif // #ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_WIDE_STREAMS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/windows_posix.hpp b/include/ndnboost/iostreams/detail/config/windows_posix.hpp
new file mode 100644
index 0000000..9fd9c45
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/windows_posix.hpp
@@ -0,0 +1,25 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2004-2007 Jonathan Turkanis
+// (C) Copyright 2002, 2003 Beman Dawes   Boost.Filesystem
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_WINDOWS_POSIX_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_WINDOWS_POSIX_HPP_INCLUDED
+
+//------------------From ndnboost/libs/filesystem/src/path_posix_windows.cpp-----//
+
+// NDNBOOST_IOSTREAMS_POSIX or NDNBOOST_IOSTREAMS_WINDOWS specify which API to use.
+#if !defined( NDNBOOST_IOSTREAMS_WINDOWS ) && !defined( NDNBOOST_IOSTREAMS_POSIX )
+# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \
+     !defined(__CYGWIN__) \
+     /**/
+#  define NDNBOOST_IOSTREAMS_WINDOWS
+# else
+#  define NDNBOOST_IOSTREAMS_POSIX
+# endif
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_WINDOWS_POSIX_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/config/zlib.hpp b/include/ndnboost/iostreams/detail/config/zlib.hpp
new file mode 100644
index 0000000..e3df50a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/config/zlib.hpp
@@ -0,0 +1,50 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Adapted from <ndnboost/config/auto_link.hpp> and from
+// http://www.boost.org/more/separate_compilation.html, by John Maddock.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_ZLIB_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CONFIG_ZLIB_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/config.hpp> // NDNBOOST_STRINGIZE.
+
+#if defined(NDNBOOST_ZLIB_BINARY)
+# if defined(NDNBOOST_MSVC) || \
+     defined(__BORLANDC__) || \
+     (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) || \
+     (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) \
+     /**/
+
+// Specify the name of the .lib file.
+#  pragma comment(lib, NDNBOOST_STRINGIZE(NDNBOOST_ZLIB_BINARY))
+# endif
+#else 
+# if !defined(NDNBOOST_IOSTREAMS_SOURCE) && \
+     !defined(NDNBOOST_ALL_NO_LIB) && \
+     !defined(NDNBOOST_IOSTREAMS_NO_LIB) \
+     /**/
+
+// Set the name of our library, this will get undef'ed by auto_link.hpp
+// once it's done with it.
+#  define NDNBOOST_LIB_NAME ndnboost_zlib
+
+// If we're importing code from a dll, then tell auto_link.hpp about it.
+#  if defined(NDNBOOST_ALL_DYN_LINK) || defined(NDNBOOST_IOSTREAMS_DYN_LINK)
+#   define NDNBOOST_DYN_LINK
+#  endif
+
+// And include the header that does the work.
+#  include <ndnboost/config/auto_link.hpp>
+# endif
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CONFIG_ZLIB_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/counted_array.hpp b/include/ndnboost/iostreams/detail/counted_array.hpp
new file mode 100644
index 0000000..5305898
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/counted_array.hpp
@@ -0,0 +1,64 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_COUNTED_ARRAY_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_COUNTED_ARRAY_HPP_INCLUDED
+
+#include <algorithm>                               // min.
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/char_traits.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>          // streamsize.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Ch>
+class counted_array_source {
+public:
+    typedef Ch          char_type;
+    typedef source_tag  category;
+    counted_array_source(const Ch* buf, std::streamsize size) 
+        : buf_(buf), ptr_(0), end_(size)
+        { }
+    std::streamsize read(Ch* s, std::streamsize n)
+    {
+        std::streamsize result = (std::min)(n, end_ - ptr_);
+        NDNBOOST_IOSTREAMS_CHAR_TRAITS(char_type)::copy
+            (s, buf_ + ptr_, result);
+        ptr_ += result;
+        return result;
+    }
+    std::streamsize count() const { return ptr_; }
+private:
+    const Ch*        buf_;
+    std::streamsize  ptr_, end_;
+};
+
+template<typename Ch>
+struct counted_array_sink {
+public:
+    typedef Ch        char_type;
+    typedef sink_tag  category;
+    counted_array_sink(Ch* buf, std::streamsize size) 
+        : buf_(buf), ptr_(0), end_(size)
+        { }
+        std::streamsize write(const Ch* s, std::streamsize n)
+    {
+        std::streamsize result = (std::min)(n, end_ - ptr_);
+        NDNBOOST_IOSTREAMS_CHAR_TRAITS(char_type)::copy
+            (buf_ + ptr_, s, result);
+        ptr_ += result;
+        return result;
+    }
+    std::streamsize count() const { return ptr_; }
+private:
+    Ch*              buf_;
+    std::streamsize  ptr_, end_;
+};
+
+} } } // End namespaces iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_COUNTED_ARRAY_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/current_directory.hpp b/include/ndnboost/iostreams/detail/current_directory.hpp
new file mode 100644
index 0000000..fda6950
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/current_directory.hpp
@@ -0,0 +1,65 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+
+ * File:        ndnboost/iostreams/detail/execute.hpp
+ * Date:        Thu Dec 06 13:21:54 MST 2007
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Defines the function ndnboost::iostreams::detail::current_directory, used by 
+ * ndnboost::iostreams::detail::absolute_path.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CURRENT_DIRECTORY_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CURRENT_DIRECTORY_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>  // make sure size_t is in std.
+#include <cstddef>           // size_t
+#include <string>
+#include <ndnboost/iostreams/detail/buffer.hpp>
+#include <ndnboost/iostreams/detail/config/windows_posix.hpp>
+#include <ndnboost/iostreams/detail/system_failure.hpp>
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+# define WIN32_LEAN_AND_MEAN  // Exclude rarely-used stuff from Windows headers
+# include <windows.h>
+#else
+# include <unistd.h>        // sysconf.
+#endif
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+// Returns the current working directory
+inline std::string current_directory()
+{
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+    DWORD               length;
+    basic_buffer<char>  buf(MAX_PATH);
+    while (true) {
+        length = ::GetCurrentDirectoryA(buf.size(), buf.data());
+        if (!length)
+            throw_system_failure("failed determining current directory");
+        if (length < static_cast<DWORD>(buf.size()))
+            break;
+        buf.resize(buf.size() * 2);
+    }
+    return std::string(buf.data(), length);
+#else // #ifdef NDNBOOST_IOSTREAMS_WINDOWS
+    basic_buffer<char> buf(pathconf(".", _PC_PATH_MAX));
+    if (!getcwd(buf.data(), static_cast<size_t>(buf.size())))
+        throw_system_failure("failed determining current directory");
+    return std::string(buf.data());
+#endif // #ifdef NDNBOOST_IOSTREAMS_WINDOWS
+}
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp>
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CURRENT_DIRECTORY_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/default_arg.hpp b/include/ndnboost/iostreams/detail/default_arg.hpp
new file mode 100644
index 0000000..c85aae6
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/default_arg.hpp
@@ -0,0 +1,25 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_DEFAULT_ARG_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_DEFAULT_ARG_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif            
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
+# include <ndnboost/mpl/identity.hpp>
+# define NDNBOOST_IOSTREAMS_DEFAULT_ARG(arg) mpl::identity< arg >::type
+#else
+# define NDNBOOST_IOSTREAMS_DEFAULT_ARG(arg) arg
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_DEFAULT_ARG_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/dispatch.hpp b/include/ndnboost/iostreams/detail/dispatch.hpp
new file mode 100644
index 0000000..fa7e926
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/dispatch.hpp
@@ -0,0 +1,41 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_DISPATCH_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_DISPATCH_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp>                   // NDNBOOST_DEDUCED_TYPENAME. 
+#include <ndnboost/iostreams/detail/select.hpp>
+#include <ndnboost/iostreams/traits.hpp>         // category_of. 
+#include <ndnboost/mpl/void.hpp>          
+#include <ndnboost/type_traits/is_convertible.hpp>         
+
+namespace ndnboost { namespace iostreams {namespace detail {
+    
+template< typename T, typename Tag1, typename Tag2,
+          typename Tag3 = mpl::void_, typename Tag4 = mpl::void_,
+          typename Tag5 = mpl::void_, typename Tag6 = mpl::void_,
+          typename Category = 
+              NDNBOOST_DEDUCED_TYPENAME category_of<T>::type >
+struct dispatch 
+    : iostreams::select<  // Disambiguation for Tru64.
+          is_convertible<Category, Tag1>, Tag1,
+          is_convertible<Category, Tag2>, Tag2,
+          is_convertible<Category, Tag3>, Tag3,
+          is_convertible<Category, Tag4>, Tag4,
+          is_convertible<Category, Tag5>, Tag5,
+          is_convertible<Category, Tag6>, Tag6
+      >
+    { };
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_DISPATCH_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/double_object.hpp b/include/ndnboost/iostreams/detail/double_object.hpp
new file mode 100644
index 0000000..dd23f7a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/double_object.hpp
@@ -0,0 +1,114 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2004-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Contains the definition of the class template 
+// ndnboost::iostreams::detail::double_object, which is similar to compressed pair
+// except that both members of the pair have the same type, and 
+// compression occurs only if requested using a boolean template
+// parameter.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_DOUBLE_OBJECT_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_DOUBLE_OBJECT_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <algorithm>              // swap.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/mpl/if.hpp>
+#if NDNBOOST_WORKAROUND(__MWERKS__, > 0x3003)
+# include <msl_utility>
+#else
+# include <ndnboost/call_traits.hpp>
+#endif
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename T>
+class single_object_holder {
+public:
+#if NDNBOOST_WORKAROUND(__MWERKS__, > 0x3003)
+    typedef Metrowerks::call_traits<T>             traits_type;
+#else
+    typedef ndnboost::call_traits<T>                  traits_type;
+#endif
+    typedef typename traits_type::param_type       param_type;
+    typedef typename traits_type::reference        reference;
+    typedef typename traits_type::const_reference  const_reference;
+    single_object_holder() { }
+    single_object_holder(param_type t) : first_(t) { }
+    reference first() { return first_; }
+    const_reference first() const { return first_; }
+    reference second() { return first_; }
+    const_reference second() const { return first_; }
+    void swap(single_object_holder& o)
+    { std::swap(first_, o.first_); }
+private:
+    T first_;
+};
+
+template<typename T>
+struct double_object_holder {
+public:
+#if NDNBOOST_WORKAROUND(__MWERKS__, > 0x3003)
+    typedef Metrowerks::call_traits<T>             traits_type;
+#else
+    typedef ndnboost::call_traits<T>                  traits_type;
+#endif
+    typedef typename traits_type::param_type       param_type;
+    typedef typename traits_type::reference        reference;
+    typedef typename traits_type::const_reference  const_reference;
+    double_object_holder() { }
+    double_object_holder(param_type t1, param_type t2)
+        : first_(t1), second_(t2) { }
+    reference first() { return first_; }
+    const_reference first() const { return first_; }
+    reference second() { return second_; }
+    const_reference second() const { return second_; }
+    void swap(double_object_holder& d)
+    { 
+        std::swap(first_, d.first_); 
+        std::swap(second_, d.second_); 
+    }
+private:
+    T first_, second_;
+};
+
+template<typename T, typename IsDouble>
+class double_object 
+    : public mpl::if_<
+                 IsDouble, 
+                 double_object_holder<T>, 
+                 single_object_holder<T>
+             >::type
+{
+private:
+    typedef typename 
+            mpl::if_<
+                IsDouble, 
+                double_object_holder<T>, 
+                single_object_holder<T>
+            >::type                                base_type;
+public:
+#if NDNBOOST_WORKAROUND(__MWERKS__, > 0x3003)
+    typedef Metrowerks::call_traits<T>             traits_type;
+#else
+    typedef ndnboost::call_traits<T>                  traits_type;
+#endif
+    typedef typename traits_type::param_type       param_type;
+    typedef typename traits_type::reference        reference;
+    typedef typename traits_type::const_reference  const_reference;
+    double_object() : base_type() {}
+    double_object(param_type t1, param_type t2)
+        : base_type(t1, t2) { }
+    bool is_double() const { return IsDouble::value; }
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_DOUBLE_OBJECT_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/enable_if_stream.hpp b/include/ndnboost/iostreams/detail/enable_if_stream.hpp
new file mode 100644
index 0000000..a96dfe0
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/enable_if_stream.hpp
@@ -0,0 +1,32 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_ENABLE_IF_STREAM_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_ENABLE_IF_STREAM_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp>                // NDNBOOST_NO_SFINAE.
+#include <ndnboost/utility/enable_if.hpp>                  
+#include <ndnboost/iostreams/traits_fwd.hpp>  // is_std_io.
+
+#if !defined(NDNBOOST_NO_SFINAE) && \
+    !NDNBOOST_WORKAROUND(__BORLANDC__, NDNBOOST_TESTED_AT(0x592))
+# define NDNBOOST_IOSTREAMS_ENABLE_IF_STREAM(T) \
+    , typename ndnboost::enable_if< ndnboost::iostreams::is_std_io<T> >::type* = 0 \
+    /**/
+# define NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T) \
+    , typename ndnboost::disable_if< ndnboost::iostreams::is_std_io<T> >::type* = 0 \
+    /**/
+#else 
+# define NDNBOOST_IOSTREAMS_ENABLE_IF_STREAM(T)
+# define NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T)
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_ENABLE_IF_STREAM_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/error.hpp b/include/ndnboost/iostreams/detail/error.hpp
new file mode 100644
index 0000000..0489190
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/error.hpp
@@ -0,0 +1,45 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_ERROR_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_ERROR_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+                 
+#include <ndnboost/iostreams/detail/ios.hpp>  // failure.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+inline NDNBOOST_IOSTREAMS_FAILURE cant_read() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("no read access"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE cant_write() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("no write access"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE cant_seek() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("no random access"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE bad_read() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("bad read"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE bad_putback() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("putback buffer full"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE bad_write() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("bad write"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE write_area_exhausted() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("write area exhausted"); }
+
+inline NDNBOOST_IOSTREAMS_FAILURE bad_seek() 
+{ return NDNBOOST_IOSTREAMS_FAILURE("bad seek"); }
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_ERROR_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/execute.hpp b/include/ndnboost/iostreams/detail/execute.hpp
new file mode 100644
index 0000000..73240c8
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/execute.hpp
@@ -0,0 +1,135 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+
+ * File:        ndnboost/iostreams/detail/execute.hpp
+ * Date:        Thu Dec 06 13:21:54 MST 2007
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+
+ * Defines the overloaded function template 
+ * ndnboost::iostreams::detail::execute_all() and the function template 
+ * ndnboost::iostreams::detail::execute_foreach().
+ *
+ * execute_all() invokes a primary operation and performs a sequence of cleanup 
+ * operations, returning the result of the primary operation if no exceptions
+ * are thrown. If one of the operations throws an exception, performs the
+ * remaining operations and rethrows the initial exception.
+ *
+ * execute_foreach() is a variant of std::foreach which invokes a function 
+ * object for each item in a sequence, catching all execptions and rethrowing
+ * the first caught exception after the function object has been invoked on each
+ * item.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_EXECUTE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_EXECUTE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/config/limits.hpp>   // MAX_EXECUTE_ARITY
+#include <ndnboost/preprocessor/arithmetic/dec.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/iteration/local.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
+#include <ndnboost/preprocessor/punctuation/comma_if.hpp>
+#include <ndnboost/utility/result_of.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+// Helper for class template execute_traits.
+template<typename Result>
+struct execute_traits_impl {
+    typedef Result result_type;
+    template<typename Op>
+    static Result execute(Op op) { return op(); }
+};
+
+// Specialization for void return. For simplicity, execute() returns int 
+// for operations returning void. This could be avoided with additional work.
+template<>
+struct execute_traits_impl<void> {
+    typedef int result_type;
+    template<typename Op>
+    static int execute(Op op) { op(); return 0; }
+};
+
+// Deduces the result type of Op and allows uniform treatment of operations 
+// returning void and non-void.
+template< typename Op, 
+          typename Result = // VC6.5 workaround.
+              #if !defined(NDNBOOST_NO_RESULT_OF) && \
+                  !NDNBOOST_WORKAROUND(__BORLANDC__, NDNBOOST_TESTED_AT(0x592))
+                  typename ndnboost::result_of<Op()>::type
+              #else
+                  NDNBOOST_DEDUCED_TYPENAME Op::result_type
+              #endif
+          >
+struct execute_traits 
+    : execute_traits_impl<Result>
+    { };
+
+// Implementation with no cleanup operations.
+template<typename Op>
+typename execute_traits<Op>::result_type 
+execute_all(Op op) 
+{ 
+    return execute_traits<Op>::execute(op);
+}
+
+// Implementation with one or more cleanup operations
+#define NDNBOOST_PP_LOCAL_MACRO(n) \
+   template<typename Op, NDNBOOST_PP_ENUM_PARAMS(n, typename C)> \
+   typename execute_traits<Op>::result_type \
+   execute_all(Op op, NDNBOOST_PP_ENUM_BINARY_PARAMS(n, C, c)) \
+   { \
+       typename execute_traits<Op>::result_type r; \
+       try { \
+           r = ndnboost::iostreams::detail::execute_all( \
+                   op NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+                   NDNBOOST_PP_ENUM_PARAMS(NDNBOOST_PP_DEC(n), c) \
+               ); \
+       } catch (...) { \
+           try { \
+               NDNBOOST_PP_CAT(c, NDNBOOST_PP_DEC(n))(); \
+           } catch (...) { } \
+           throw; \
+       } \
+       NDNBOOST_PP_CAT(c, NDNBOOST_PP_DEC(n))(); \
+       return r; \
+   } \
+   /**/
+
+#define NDNBOOST_PP_LOCAL_LIMITS (1, NDNBOOST_IOSTREAMS_MAX_EXECUTE_ARITY)
+#include NDNBOOST_PP_LOCAL_ITERATE()
+#undef NDNBOOST_PP_LOCAL_MACRO
+
+template<class InIt, class Op>
+Op execute_foreach(InIt first, InIt last, Op op)
+{
+    if (first == last)
+        return op;
+    try {
+        op(*first);
+    } catch (...) {
+        try {
+            ++first;
+            ndnboost::iostreams::detail::execute_foreach(first, last, op);
+        } catch (...) { }
+        throw;
+    }
+    ++first;
+    return ndnboost::iostreams::detail::execute_foreach(first, last, op);
+}
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_EXECUTE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/file_handle.hpp b/include/ndnboost/iostreams/detail/file_handle.hpp
new file mode 100644
index 0000000..4f35d1d
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/file_handle.hpp
@@ -0,0 +1,32 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+ *
+ * File:        ndnboost/iostreams/detail/file_handle.hpp
+ * Date:        Sun Jun 22 14:23:12 MDT 2008
+ * Copyright:   2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Defines the type ndnboost::iostreams::detail::file_handle, representing an
+ * operating system file handle.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_FILE_HANDLE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_FILE_HANDLE_HPP_INCLUDED
+
+#include <ndnboost/iostreams/detail/config/windows_posix.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+    typedef void*  file_handle;  // A.k.a. HANDLE
+#else
+    typedef int    file_handle;
+#endif
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_FILE_HANDLE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/forward.hpp b/include/ndnboost/iostreams/detail/forward.hpp
new file mode 100644
index 0000000..a45b903
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/forward.hpp
@@ -0,0 +1,124 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_FORWARD_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_FORWARD_HPP_INCLUDED   
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif                  
+ 
+#include <ndnboost/config.hpp> // NDNBOOST_MSVC, NDNBOOST_NO_SFINAE
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/config/limits.hpp>
+#include <ndnboost/iostreams/detail/push_params.hpp>
+#include <ndnboost/preprocessor/arithmetic/dec.hpp>
+#include <ndnboost/preprocessor/arithmetic/inc.hpp>
+#include <ndnboost/preprocessor/punctuation/comma_if.hpp>
+#include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/preprocessor/repetition/repeat_from_to.hpp>
+#include <ndnboost/preprocessor/tuple/elem.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+
+//------Macros for defining forwarding constructors and open overloads--------//
+    
+//
+// Macro: NDNBOOST_IOSTREAMS_FORWARD(class, impl, device, params, args)
+// Description: Defines constructors and overloads of 'open' which construct
+//      a device using the specified argument list and pass it to the specified
+//      helper function
+//   class - The class name
+//   impl - The helper function
+//   device - The device type
+//   params - The list of formal parameters trailing the device parameter in
+//     the helper function's signature
+//   params - The list of arguments passed to the helper function, following the
+//     device argument
+//
+#define NDNBOOST_IOSTREAMS_FORWARD(class, impl, device, params, args) \
+    class(const device& t params()) \
+    { this->impl(::ndnboost::iostreams::detail::wrap(t) args()); } \
+    class(device& t params()) \
+    { this->impl(::ndnboost::iostreams::detail::wrap(t) args()); } \
+    class(const ::ndnboost::reference_wrapper<device>& ref params()) \
+    { this->impl(ref args()); } \
+    void open(const device& t params()) \
+    { this->impl(::ndnboost::iostreams::detail::wrap(t) args()); } \
+    void open(device& t params()) \
+    { this->impl(::ndnboost::iostreams::detail::wrap(t) args()); } \
+    void open(const ::ndnboost::reference_wrapper<device>& ref params()) \
+    { this->impl(ref args()); } \
+    NDNBOOST_PP_REPEAT_FROM_TO( \
+        1, NDNBOOST_PP_INC(NDNBOOST_IOSTREAMS_MAX_FORWARDING_ARITY), \
+        NDNBOOST_IOSTREAMS_FORWARDING_CTOR, (class, impl, device) \
+    ) \
+    NDNBOOST_PP_REPEAT_FROM_TO( \
+        1, NDNBOOST_PP_INC(NDNBOOST_IOSTREAMS_MAX_FORWARDING_ARITY), \
+        NDNBOOST_IOSTREAMS_FORWARDING_FN, (class, impl, device) \
+    ) \
+    /**/
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
+# define NDNBOOST_IOSTREAMS_FORWARDING_CTOR_I(z, n, tuple) \
+    template< typename U100 NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+              NDNBOOST_PP_ENUM_PARAMS_Z(z, NDNBOOST_PP_DEC(n), typename U) > \
+    NDNBOOST_PP_TUPLE_ELEM(3, 0, tuple) \
+    ( U100& u100 NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+      NDNBOOST_PP_ENUM_BINARY_PARAMS_Z(z, NDNBOOST_PP_DEC(n), const U, &u) \
+      NDNBOOST_IOSTREAMS_DISABLE_IF_SAME(U100, NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple))) \
+    { this->NDNBOOST_PP_TUPLE_ELEM(3, 1, tuple) \
+      ( NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple) \
+        ( u100 NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+          NDNBOOST_PP_ENUM_PARAMS_Z(z, NDNBOOST_PP_DEC(n), u)) ); } \
+    /**/
+# define NDNBOOST_IOSTREAMS_FORWARDING_FN_I(z, n, tuple) \
+    template< typename U100 NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+              NDNBOOST_PP_ENUM_PARAMS_Z(z, NDNBOOST_PP_DEC(n), typename U) > \
+    void open \
+    ( U100& u100 NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+      NDNBOOST_PP_ENUM_BINARY_PARAMS_Z(z, NDNBOOST_PP_DEC(n), const U, &u) \
+      NDNBOOST_IOSTREAMS_DISABLE_IF_SAME(U100, NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple))) \
+    { this->NDNBOOST_PP_TUPLE_ELEM(3, 1, tuple) \
+      ( u100 NDNBOOST_PP_COMMA_IF(NDNBOOST_PP_DEC(n)) \
+        NDNBOOST_PP_ENUM_PARAMS_Z(z, NDNBOOST_PP_DEC(n), u) ); } \
+    /**/
+#else
+# define NDNBOOST_IOSTREAMS_FORWARDING_CTOR_I(z, n, tuple)
+# define NDNBOOST_IOSTREAMS_FORWARDING_FN_I(z, n, tuple)
+#endif
+#define NDNBOOST_IOSTREAMS_FORWARDING_CTOR(z, n, tuple) \
+    template<NDNBOOST_PP_ENUM_PARAMS_Z(z, n, typename U)> \
+    NDNBOOST_PP_TUPLE_ELEM(3, 0, tuple) \
+    (NDNBOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, const U, &u) \
+      NDNBOOST_IOSTREAMS_DISABLE_IF_SAME(U0, NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple))) \
+    { this->NDNBOOST_PP_TUPLE_ELEM(3, 1, tuple) \
+      ( NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple) \
+        (NDNBOOST_PP_ENUM_PARAMS_Z(z, n, u)) ); } \
+    NDNBOOST_IOSTREAMS_FORWARDING_CTOR_I(z, n, tuple) \
+    /**/
+#define NDNBOOST_IOSTREAMS_FORWARDING_FN(z, n, tuple) \
+    template<NDNBOOST_PP_ENUM_PARAMS_Z(z, n, typename U)> \
+    void open(NDNBOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, const U, &u) \
+      NDNBOOST_IOSTREAMS_DISABLE_IF_SAME(U0, NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple))) \
+    { this->NDNBOOST_PP_TUPLE_ELEM(3, 1, tuple) \
+      ( NDNBOOST_PP_TUPLE_ELEM(3, 2, tuple) \
+        (NDNBOOST_PP_ENUM_PARAMS_Z(z, n, u)) ); } \
+    NDNBOOST_IOSTREAMS_FORWARDING_FN_I(z, n, tuple) \
+    /**/
+
+// Disable forwarding constructors if first parameter type is the same
+// as the device type
+#if !defined(NDNBOOST_NO_SFINAE) && \
+    !NDNBOOST_WORKAROUND(__BORLANDC__, NDNBOOST_TESTED_AT(0x592))
+# define NDNBOOST_IOSTREAMS_DISABLE_IF_SAME(device, param) \
+    , typename ndnboost::disable_if< ndnboost::is_same<device, param> >::type* = 0 \
+    /**/
+#else 
+# define NDNBOOST_IOSTREAMS_DISABLE_IF_SAME(device, param)
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_FORWARD_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/fstream.hpp b/include/ndnboost/iostreams/detail/fstream.hpp
new file mode 100644
index 0000000..50620a7
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/fstream.hpp
@@ -0,0 +1,33 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_FSTREAM_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_FSTREAM_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+                 
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# include <fstream>
+#else
+# include <fstream.h>
+#endif 
+
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# define NDNBOOST_IOSTREAMS_BASIC_IFSTREAM(Ch, Tr) std::basic_ifstream<Ch, Tr>
+# define NDNBOOST_IOSTREAMS_BASIC_OFSTREAM(Ch, Tr) std::basic_ofstream<Ch, Tr>
+# define NDNBOOST_IOSTREAMS_BASIC_FSTREAM(Ch, Tr) std::basic_fstream<Ch, Tr>
+# define NDNBOOST_IOSTREAMS_BASIC_FILEBUF(Ch) std::basic_filebuf<Ch>
+#else 
+# define NDNBOOST_IOSTREAMS_BASIC_IFSTREAM(Ch, Tr) std::ifstream
+# define NDNBOOST_IOSTREAMS_BASIC_OFSTREAM(Ch, Tr) std::ofstream
+# define NDNBOOST_IOSTREAMS_BASIC_FILEBUF(Ch) std::filebuf
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_FSTREAM_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/functional.hpp b/include/ndnboost/iostreams/detail/functional.hpp
new file mode 100644
index 0000000..52a825e
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/functional.hpp
@@ -0,0 +1,189 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+
+ * File:        ndnboost/iostreams/detail/functional.hpp
+ * Date:        Sun Dec 09 05:38:03 MST 2007
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+
+ * Defines several function objects and object generators for use with 
+ * execute_all()
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_FUNCTIONAL_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_FUNCTIONAL_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/iostreams/close.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp> // NDNBOOST_IOS
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+    // Function objects and object generators for invoking
+    // ndnboost::iostreams::close
+
+template<typename T>
+class device_close_operation {
+public:
+    typedef void result_type;
+    device_close_operation(T& t, NDNBOOST_IOS::openmode which) 
+        : t_(t), which_(which) 
+        { }
+    void operator()() const { ndnboost::iostreams::close(t_, which_); }
+private:
+    device_close_operation& operator=(const device_close_operation&);
+    T&                   t_;
+    NDNBOOST_IOS::openmode  which_;
+};
+
+template<typename T, typename Sink>
+class filter_close_operation {
+public:
+    typedef void result_type;
+    filter_close_operation(T& t, Sink& snk, NDNBOOST_IOS::openmode which)
+        : t_(t), snk_(snk), which_(which)
+        { }
+    void operator()() const { ndnboost::iostreams::close(t_, snk_, which_); }
+private:
+    filter_close_operation& operator=(const filter_close_operation&);
+    T&                   t_;
+    Sink&                snk_;
+    NDNBOOST_IOS::openmode  which_;
+};
+
+template<typename T>
+device_close_operation<T> 
+call_close(T& t, NDNBOOST_IOS::openmode which) 
+{ return device_close_operation<T>(t, which); }
+
+template<typename T, typename Sink>
+filter_close_operation<T, Sink> 
+call_close(T& t, Sink& snk, NDNBOOST_IOS::openmode which) 
+{ return filter_close_operation<T, Sink>(t, snk, which); }
+
+    // Function objects and object generators for invoking
+    // ndnboost::iostreams::detail::close_all
+
+template<typename T>
+class device_close_all_operation {
+public:
+    typedef void result_type;
+    device_close_all_operation(T& t) : t_(t) { }
+    void operator()() const { detail::close_all(t_); }
+private:
+    device_close_all_operation& operator=(const device_close_all_operation&);
+    T& t_;
+};
+
+template<typename T, typename Sink>
+class filter_close_all_operation {
+public:
+    typedef void result_type;
+    filter_close_all_operation(T& t, Sink& snk) : t_(t), snk_(snk) { }
+    void operator()() const { detail::close_all(t_, snk_); }
+private:
+    filter_close_all_operation& operator=(const filter_close_all_operation&);
+    T&     t_;
+    Sink&  snk_;
+};
+
+template<typename T>
+device_close_all_operation<T> call_close_all(T& t) 
+{ return device_close_all_operation<T>(t); }
+
+template<typename T, typename Sink>
+filter_close_all_operation<T, Sink> 
+call_close_all(T& t, Sink& snk) 
+{ return filter_close_all_operation<T, Sink>(t, snk); }
+
+    // Function object and object generator for invoking a
+    // member function void close(std::ios_base::openmode)
+
+template<typename T>
+class member_close_operation {
+public:
+    typedef void result_type;
+    member_close_operation(T& t, NDNBOOST_IOS::openmode which) 
+        : t_(t), which_(which) 
+        { }
+    void operator()() const { t_.close(which_); }
+private:
+    member_close_operation& operator=(const member_close_operation&);
+    T&                   t_;
+    NDNBOOST_IOS::openmode  which_;
+};
+
+template<typename T>
+member_close_operation<T> call_member_close(T& t, NDNBOOST_IOS::openmode which) 
+{ return member_close_operation<T>(t, which); }
+
+    // Function object and object generator for invoking a
+    // member function void reset()
+
+template<typename T>
+class reset_operation {
+public:
+    reset_operation(T& t) : t_(t) { }
+    void operator()() const { t_.reset(); }
+private:
+    reset_operation& operator=(const reset_operation&);
+    T& t_;
+};
+
+template<typename T>
+reset_operation<T> call_reset(T& t) { return reset_operation<T>(t); }
+
+    // Function object and object generator for clearing a flag
+
+template<typename T>
+class clear_flags_operation {
+public:
+    typedef void result_type;
+    clear_flags_operation(T& t) : t_(t) { }
+    void operator()() const { t_ = 0; }
+private:
+    clear_flags_operation& operator=(const clear_flags_operation&);
+    T& t_;
+};
+
+template<typename T>
+clear_flags_operation<T> clear_flags(T& t) 
+{ return clear_flags_operation<T>(t); }
+
+    // Function object and generator for flushing a buffer
+
+// Function object for use with execute_all()
+template<typename Buffer, typename Device>
+class flush_buffer_operation {
+public:
+    typedef void result_type;
+    flush_buffer_operation(Buffer& buf, Device& dev, bool flush)
+        : buf_(buf), dev_(dev), flush_(flush)
+        { }
+    void operator()() const
+    {
+        if (flush_) 
+            buf_.flush(dev_);
+    }
+private:
+    flush_buffer_operation& operator=(const flush_buffer_operation&);
+    Buffer&  buf_;
+    Device&  dev_;
+    bool     flush_;
+};
+
+template<typename Buffer, typename Device>
+flush_buffer_operation<Buffer, Device> 
+flush_buffer(Buffer& buf, Device& dev, bool flush)
+{ return flush_buffer_operation<Buffer, Device>(buf, dev, flush); }
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_FUNCTIONAL_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/ios.hpp b/include/ndnboost/iostreams/detail/ios.hpp
new file mode 100644
index 0000000..9d3cfc0
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/ios.hpp
@@ -0,0 +1,66 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_IOS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_IOS_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+                 
+#include <ndnboost/config.hpp> // NDNBOOST_MSVC.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# if !NDNBOOST_WORKAROUND(__MWERKS__, <= 0x3003)
+#  include <ios>
+# else
+#  include <istream>
+#  include <ostream>
+# endif
+#else 
+# include <exception>
+# include <iosfwd>
+#endif 
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------------------//
+# define NDNBOOST_IOSTREAMS_BASIC_IOS(ch, tr)  std::basic_ios< ch, tr >
+# if !NDNBOOST_WORKAROUND(__MWERKS__, <= 0x3003) && \
+     !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
+     !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300) \
+     /**/
+
+#define NDNBOOST_IOS                std::ios
+#define NDNBOOST_IOSTREAMS_FAILURE  std::ios::failure
+
+# else
+
+#define NDNBOOST_IOS                std::ios_base
+#define NDNBOOST_IOSTREAMS_FAILURE  std::ios_base::failure
+
+# endif
+#else // #ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-----------------------//
+
+#define NDNBOOST_IOS                          std::ios
+#define NDNBOOST_IOSTREAMS_BASIC_IOS(ch, tr)  std::ios
+#define NDNBOOST_IOSTREAMS_FAILURE            ndnboost::iostreams::detail::failure
+
+class failure : std::exception {    
+public:
+    explicit failure(const std::string& what_arg) : what_(what_arg) { }
+    const char* what() const { return what_.c_str(); }
+private:
+    std::string what_;
+};
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //----------------------//
+
+} } } // End namespace failure, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_IOS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/iostream.hpp b/include/ndnboost/iostreams/detail/iostream.hpp
new file mode 100644
index 0000000..26d21ab
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/iostream.hpp
@@ -0,0 +1,34 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_IOSTREAM_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_IOSTREAM_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+                 
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# include <istream>
+# include <ostream>
+#else
+# include <iostream.h>
+#endif
+
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# define NDNBOOST_IOSTREAMS_BASIC_ISTREAM(ch, tr) std::basic_istream< ch, tr >
+# define NDNBOOST_IOSTREAMS_BASIC_OSTREAM(ch, tr) std::basic_ostream< ch, tr >
+# define NDNBOOST_IOSTREAMS_BASIC_IOSTREAM(ch, tr) std::basic_iostream< ch, tr >
+#else
+# define NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(ch, tr) std::streambuf
+# define NDNBOOST_IOSTREAMS_BASIC_ISTREAM(ch, tr) std::istream
+# define NDNBOOST_IOSTREAMS_BASIC_OSTREAM(ch, tr) std::ostream
+# define NDNBOOST_IOSTREAMS_BASIC_IOSTREAM(ch, tr) std::iostream
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_IOSTREAM_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/is_dereferenceable.hpp b/include/ndnboost/iostreams/detail/is_dereferenceable.hpp
new file mode 100644
index 0000000..7ee8c58
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/is_dereferenceable.hpp
@@ -0,0 +1,85 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// (C) Copyright David Abrahams 2004.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
+
+# include <ndnboost/type_traits/detail/bool_trait_def.hpp>
+# include <ndnboost/type_traits/detail/template_arity_spec.hpp>
+# include <ndnboost/type_traits/remove_cv.hpp>
+# include <ndnboost/mpl/aux_/lambda_support.hpp>
+# include <ndnboost/mpl/bool.hpp>
+# include <ndnboost/detail/workaround.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail { 
+
+// is_dereferenceable<T> metafunction
+//
+// Requires: Given x of type T&, if the expression *x is well-formed
+// it must have complete type; otherwise, it must neither be ambiguous
+// nor violate access.
+
+// This namespace ensures that ADL doesn't mess things up.
+namespace is_dereferenceable_
+{
+  // a type returned from operator* when no increment is found in the
+  // type's own namespace
+  struct tag {};
+  
+  // any soaks up implicit conversions and makes the following
+  // operator* less-preferred than any other such operator that
+  // might be found via ADL.
+  struct any { template <class T> any(T const&); };
+
+  // This is a last-resort operator* for when none other is found
+  tag operator*(any const&);
+
+# if NDNBOOST_WORKAROUND(__MWERKS__, NDNBOOST_TESTED_AT(0x3202)) \
+    || NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300)
+#  define NDNBOOST_comma(a,b) (a)
+# else 
+  // In case an operator++ is found that returns void, we'll use ++x,0
+  tag operator,(tag,int);  
+#  define NDNBOOST_comma(a,b) (a,b)
+# endif 
+  
+  // two check overloads help us identify which operator++ was picked
+  char (& check_increment(tag) )[2];
+  
+  template <class T>
+  char check_increment(T const&);
+  
+  template <class T>
+  struct impl
+  {
+      static typename ndnboost::remove_cv<T>::type& x;
+
+      NDNBOOST_STATIC_CONSTANT(
+          bool
+        , value = sizeof(is_dereferenceable_::check_increment(NDNBOOST_comma(*x,0))) == 1
+      );
+  };
+}
+
+# undef NDNBOOST_comma
+
+template<typename T> 
+struct is_dereferenceable 
+    NDNBOOST_TT_AUX_BOOL_C_BASE(is_dereferenceable_::impl<T>::value)
+{ 
+    NDNBOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(is_dereferenceable_::impl<T>::value)
+    NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_dereferenceable,(T))
+};
+
+} } 
+
+NDNBOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::ndnboost::iostreams::detail::is_dereferenceable)
+
+} // End namespaces detail, iostreams, boost.
+
+#endif // NDNBOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/is_iterator_range.hpp b/include/ndnboost/iostreams/detail/is_iterator_range.hpp
new file mode 100644
index 0000000..3dcbcc5
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/is_iterator_range.hpp
@@ -0,0 +1,49 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_IS_ITERATOR_RANGE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_IS_ITERATOR_RANGE_HPP_INCLUDED       
+ 
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/bool_trait_def.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp>
+
+namespace ndnboost { 
+
+# if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //---------------------------------//
+
+// We avoid dependence on Boost.Range by using a forward declaration.
+template<typename Iterator>
+class iterator_range;
+    
+namespace iostreams {
+
+NDNBOOST_IOSTREAMS_BOOL_TRAIT_DEF(is_iterator_range, ndnboost::iterator_range, 1)
+
+} // End namespace iostreams.
+
+# else // # if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) //-----------------------//
+
+namespace iostreams {    
+
+    template<typename T>
+    struct is_iterator_range {
+        NDNBOOST_STATIC_CONSTANT(bool, value = false);
+    };
+
+} // End namespace iostreams.
+
+# endif // # if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300) //----------------------//
+
+} // End namespace ndnboost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp>
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_IS_ITERATOR_RANGE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/newline.hpp b/include/ndnboost/iostreams/detail/newline.hpp
new file mode 100644
index 0000000..72a7d10
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/newline.hpp
@@ -0,0 +1,32 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_NEWLINE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_NEWLINE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Ch>
+struct newline;
+
+template<>
+struct newline<char> {
+    NDNBOOST_STATIC_CONSTANT(char, value = '\n');
+};
+
+template<>
+struct newline<wchar_t> {
+    NDNBOOST_STATIC_CONSTANT(wchar_t, value = L'\n');
+};
+
+} } } // End namespaces detaill, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_NEWLINE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/optional.hpp b/include/ndnboost/iostreams/detail/optional.hpp
new file mode 100644
index 0000000..3af910a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/optional.hpp
@@ -0,0 +1,114 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Recent changes to Boost.Optional involving assigment broke Boost.Iostreams,
+// in a way which could be remedied only by relying on the deprecated reset
+// functions; with VC6, even reset didn't work. Until this problem is 
+// understood, Iostreams will use a private version of optional with a smart 
+// pointer interface.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_OPTIONAL_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_OPTIONAL_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/assert.hpp>
+#include <ndnboost/mpl/int.hpp>
+#include <ndnboost/type_traits/aligned_storage.hpp>
+#include <ndnboost/type_traits/alignment_of.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+// Taken from <ndnboost/optional.hpp>.
+template<class T>
+class aligned_storage
+{
+    // Borland ICEs if unnamed unions are used for this!
+    union dummy_u
+    {
+        char data[ sizeof(T) ];
+        NDNBOOST_DEDUCED_TYPENAME type_with_alignment<
+          ::ndnboost::alignment_of<T>::value >::type aligner_;
+    } dummy_ ;
+
+  public:
+
+    void const* address() const { return &dummy_.data[0]; }
+    void      * address()       { return &dummy_.data[0]; }
+};
+
+template<typename T>
+class optional {
+public:
+    typedef T element_type;
+    optional() : initialized_(false) { }
+    optional(const T& t) : initialized_(false) { reset(t); }
+    ~optional() { reset(); }
+    T& operator*() 
+    { 
+        NDNBOOST_ASSERT(initialized_);
+        return *static_cast<T*>(address()); 
+    }
+    const T& operator*() const
+    { 
+        NDNBOOST_ASSERT(initialized_);
+        return *static_cast<const T*>(address()); 
+    }
+    T* operator->() 
+    { 
+        NDNBOOST_ASSERT(initialized_);
+        return static_cast<T*>(address()); 
+    }
+    const T* operator->() const
+    { 
+        NDNBOOST_ASSERT(initialized_);
+        return static_cast<const T*>(address()); 
+    }
+    T* get() 
+    { 
+        NDNBOOST_ASSERT(initialized_);
+        return static_cast<T*>(address()); 
+    }
+    const T* get() const
+    { 
+        NDNBOOST_ASSERT(initialized_);
+        return static_cast<const T*>(address()); 
+    }
+    void reset() 
+    {
+        if (initialized_) { 
+        #if NDNBOOST_WORKAROUND(__BORLANDC__, NDNBOOST_TESTED_AT(0x564)) || \
+            NDNBOOST_WORKAROUND(__IBMCPP__, NDNBOOST_TESTED_AT(600)) \
+            /**/
+            T* t = static_cast<T*>(address());
+            t->~T();
+        #else
+            static_cast<T*>(address())->T::~T();
+        #endif
+            initialized_ = false;
+        }
+    }
+    void reset(const T& t) 
+    {
+        reset();
+        new (address()) T(t); 
+        initialized_ = true;
+    }
+private:
+    optional(const optional&);
+    optional& operator=(const optional&);
+    void* address() { return &storage_; }
+    const void* address() const { return &storage_; }
+    aligned_storage<T>  storage_;
+    bool                initialized_;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_OPTIONAL_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/param_type.hpp b/include/ndnboost/iostreams/detail/param_type.hpp
new file mode 100644
index 0000000..15da495
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/param_type.hpp
@@ -0,0 +1,27 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_PARAM_TYPE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_PARAM_TYPE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/mpl/if.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename T>
+struct param_type {
+    typedef typename mpl::if_<is_std_io<T>, T&, const T&>::type type;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_PARAM_TYPE_HPP_INCLUDED //-----------//
diff --git a/include/ndnboost/iostreams/detail/path.hpp b/include/ndnboost/iostreams/detail/path.hpp
new file mode 100644
index 0000000..bafc980
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/path.hpp
@@ -0,0 +1,214 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+ *
+ * File:        ndnboost/iostreams/detail/path.hpp
+ * Date:        Sat Jun 21 21:24:05 MDT 2008
+ * Copyright:   2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * Defines the class ndnboost::iostreams::detail::path, for storing a 
+ * a std::string or std::wstring.
+ *
+ * This class allows interoperability with Boost.Filesystem without
+ * creating a dependence on Boost.Filesystem headers or implementation.
+ */
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_PATH_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_PATH_HPP_INCLUDED
+
+#include <cstring>
+#include <string>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#ifndef NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS
+# include <cwchar>
+#endif
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/type.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+#ifndef NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS //------------------------------------//
+
+class path {
+    template<typename T, typename V>
+    struct sfinae
+    {
+        typedef V type;
+    };
+public:
+
+    // Default constructor
+    path() : narrow_(), wide_(), is_wide_(false) { }
+
+    // Constructor taking a std::string
+    path(const std::string& p) : narrow_(p), wide_(), is_wide_(false) { }
+
+    // Constructor taking a C-style string
+    path(const char* p) : narrow_(p), wide_(), is_wide_(false) { }
+
+    // Constructor taking a ndnboost::filesystem2::path or
+    // ndnboost::filesystem2::wpath
+    template<typename Path>
+    explicit path(const Path& p, typename Path::external_string_type* = 0)
+    {
+        init(p.external_file_string());
+    }
+
+    // Constructor taking a ndnboost::filesystem3::path (boost filesystem v3)
+    template<typename Path>
+    explicit path(const Path& p, typename Path::codecvt_type* = 0)
+    {
+        init(p.native());
+    }
+
+    // Copy constructor
+    path(const path& p) 
+        : narrow_(p.narrow_), wide_(p.wide_), is_wide_(p.is_wide_) 
+        { }
+
+    // Assignment operator taking another path
+    path& operator=(const path& p)
+    {
+        narrow_ = p.narrow_;
+        wide_ = p.wide_;
+        is_wide_ = p.is_wide_;
+        return *this;
+    }
+
+    // Assignment operator taking a std::string
+    path& operator=(const std::string& p)
+    {
+        narrow_ = p;
+        wide_.clear();
+        is_wide_ = false;
+        return *this;
+    }
+
+    // Assignment operator taking a C-style string
+    path& operator=(const char* p)
+    {
+        narrow_.assign(p);
+        wide_.clear();
+        is_wide_ = false;
+        return *this;
+    }
+
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1400)
+    // Assignment operator taking a ndnboost::filesystem2::path or
+    // ndnboost::filesystem2::wpath
+    // (not on Visual C++ 7.1/8.0, as it seems to have problems with
+    // SFINAE functions with the same parameters, doesn't seem
+    // worth working around).
+    template<typename Path>
+    typename sfinae<typename Path::external_string_type, path&>::type
+        operator=(const Path& p)
+    {
+        init(p.external_file_string());
+        return *this;
+    }
+#endif
+
+    // Assignment operator taking a ndnboost::filesystem3::path
+    template<typename Path>
+    typename sfinae<typename Path::codecvt_type, path&>::type
+        operator=(const Path& p)
+    {
+        init(p.native());
+        return *this;
+    }
+
+    bool is_wide() const { return is_wide_; }
+
+    // Returns a representation of the underlying path as a std::string
+    // Requires: is_wide() returns false
+    const char* c_str() const { return narrow_.c_str(); }
+
+    // Returns a representation of the underlying path as a std::wstring
+    // Requires: is_wide() returns true
+    const wchar_t* c_wstr() const { return wide_.c_str(); }
+private:
+    
+    // For wide-character paths, use a ndnboost::filesystem::wpath instead of a
+    // std::wstring
+    path(const std::wstring&);
+    path& operator=(const std::wstring&);
+
+    void init(std::string const& file_path)
+    {
+        narrow_ = file_path;
+        wide_.clear();
+        is_wide_ = false;
+    }
+
+    void init(std::wstring const& file_path)
+    {
+        narrow_.clear();
+        wide_ = file_path;
+        is_wide_ = true;
+    }
+
+    std::string   narrow_;
+    std::wstring  wide_;
+    bool          is_wide_;
+};
+
+inline bool operator==(const path& lhs, const path& rhs)
+{
+    return lhs.is_wide() ?
+        rhs.is_wide() && std::wcscmp(lhs.c_wstr(), rhs.c_wstr()) == 0 :
+        !rhs.is_wide() && std::strcmp(lhs.c_str(), rhs.c_str()) == 0;
+}
+
+#else // #ifndef NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS //---------------------------//
+
+class path {
+public:
+    path() { }
+    path(const std::string& p) : path_(p) { }
+    path(const char* p) : path_(p) { }
+    template<typename Path>
+        path(const Path& p) : path_(p.external_file_string()) { }
+    path(const path& p) : path_(p.path_) { }
+    path& operator=(const path& other) 
+    {
+        path_ = other.path_;
+        return *this;
+    }
+    path& operator=(const std::string& p) 
+    {
+        path_ = p;
+        return *this;
+    }
+    path& operator=(const char* p) 
+    {
+        path_ = p;
+        return *this;
+    }
+    template<typename Path>
+        path& operator=(const Path& p)
+        {
+            path_ = p.external_file_string();
+            return *this;
+        }
+    bool is_wide() const { return false; }
+    const char* c_str() const { return path_.c_str(); }
+    const wchar_t* c_wstr() const { return 0; }
+private:
+    std::string path_;
+};
+
+inline bool operator==(const path& lhs, const path& rhs)
+{
+    return std::strcmp(lhs.c_str(), rhs.c_str()) == 0 ;
+}
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_NO_WIDE_STREAMS //--------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_PATH_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/push.hpp b/include/ndnboost/iostreams/detail/push.hpp
new file mode 100644
index 0000000..5152d6a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/push.hpp
@@ -0,0 +1,154 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_PUSH_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_PUSH_HPP_INCLUDED 
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif                    
+ 
+#include <ndnboost/config.hpp> // NDNBOOST_MSVC.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/categories.hpp>
+#include <ndnboost/iostreams/detail/adapter/range_adapter.hpp>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#include <ndnboost/iostreams/detail/enable_if_stream.hpp>   
+#include <ndnboost/iostreams/pipeline.hpp>   
+#include <ndnboost/iostreams/detail/push_params.hpp>   
+#include <ndnboost/iostreams/detail/resolve.hpp>
+#include <ndnboost/mpl/bool.hpp>   
+#include <ndnboost/preprocessor/cat.hpp> 
+#include <ndnboost/preprocessor/control/iif.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+
+//
+// Macro: NDNBOOST_IOSTREAMS_DEFINE_PUSH_CONSTRUCTOR(name, mode, ch, helper).
+// Description: Defines overloads with name 'name' which forward to a function
+//      'helper' which takes a filter or devide by const reference.
+//
+#define NDNBOOST_IOSTREAMS_DEFINE_PUSH_CONSTRUCTOR(name, mode, ch, helper) \
+    NDNBOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, 0, ?) \
+    /**/
+
+//
+// Macro: NDNBOOST_IOSTREAMS_DEFINE_PUSH(name, mode, ch, helper).
+// Description: Defines constructors which forward to a function
+//      'helper' which takes a filter or device by const reference.
+//
+#define NDNBOOST_IOSTREAMS_DEFINE_PUSH(name, mode, ch, helper) \
+    NDNBOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, 1, void) \
+    /**/
+
+//--------------------Definition of NDNBOOST_IOSTREAMS_DEFINE_PUSH_IMPL----------//
+          
+#define NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, arg, helper, has_return) \
+    this->helper( ::ndnboost::iostreams::detail::resolve<mode, ch>(arg) \
+                  NDNBOOST_IOSTREAMS_PUSH_ARGS() ); \
+    /**/
+
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) && \
+    !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+    /**/
+# ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+#  define NDNBOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \
+    template<typename CharType, typename TraitsType> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(::std::basic_streambuf<CharType, TraitsType>& sb NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, sb, helper, has_return); } \
+    template<typename CharType, typename TraitsType> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(::std::basic_istream<CharType, TraitsType>& is NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_STATIC_ASSERT((!is_convertible<mode, output>::value)); \
+      NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, is, helper, has_return); } \
+    template<typename CharType, typename TraitsType> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(::std::basic_ostream<CharType, TraitsType>& os NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_STATIC_ASSERT((!is_convertible<mode, input>::value)); \
+      NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, os, helper, has_return); } \
+    template<typename CharType, typename TraitsType> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(::std::basic_iostream<CharType, TraitsType>& io NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, io, helper, has_return); } \
+    template<typename Iter> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(const iterator_range<Iter>& rng NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_PP_EXPR_IF(has_return, return) \
+    this->helper( ::ndnboost::iostreams::detail::range_adapter< \
+                      mode, iterator_range<Iter> \
+                  >(rng) \
+                  NDNBOOST_IOSTREAMS_PUSH_ARGS() ); } \
+    template<typename Pipeline, typename Concept> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(const ::ndnboost::iostreams::pipeline<Pipeline, Concept>& p) \
+    { p.push(*this); } \
+    template<typename T> \
+    NDNBOOST_PP_IIF(has_return, result, explicit) \
+    name(const T& t NDNBOOST_IOSTREAMS_PUSH_PARAMS() NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T)) \
+    { this->helper( ::ndnboost::iostreams::detail::resolve<mode, ch>(t) \
+                    NDNBOOST_IOSTREAMS_PUSH_ARGS() ); } \
+    /**/
+# else // # ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+#  define NDNBOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(::std::streambuf& sb NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, sb, helper, has_return); } \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(::std::istream& is NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_STATIC_ASSERT((!is_convertible<mode, output>::value)); \
+      NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, is, helper, has_return); } \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(::std::ostream& os NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_STATIC_ASSERT((!is_convertible<mode, input>::value)); \
+      NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, os, helper, has_return); } \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(::std::iostream& io NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, io, helper, has_return); } \
+    template<typename Iter> \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(const iterator_range<Iter>& rng NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { NDNBOOST_PP_EXPR_IF(has_return, return) \
+    this->helper( ::ndnboost::iostreams::detail::range_adapter< \
+                      mode, iterator_range<Iter> \
+                  >(rng) \
+                  NDNBOOST_IOSTREAMS_PUSH_ARGS() ); } \
+    template<typename Pipeline, typename Concept> \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(const ::ndnboost::iostreams::pipeline<Pipeline, Concept>& p) \
+    { p.push(*this); } \
+    template<typename T> \
+    NDNBOOST_PP_EXPR_IF(has_return, result) \
+    name(const T& t NDNBOOST_IOSTREAMS_PUSH_PARAMS() NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T)) \
+    { this->helper( ::ndnboost::iostreams::detail::resolve<mode, ch>(t) \
+                    NDNBOOST_IOSTREAMS_PUSH_ARGS() ); } \
+    /**/
+# endif // # ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+#else // #if VC6, VC7.0, Borland 5.x
+# define NDNBOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \
+    template<typename T> \
+    void NDNBOOST_PP_CAT(name, _msvc_impl) \
+    ( ::ndnboost::mpl::true_, const T& t NDNBOOST_IOSTREAMS_PUSH_PARAMS() ) \
+    { t.push(*this); } \
+    template<typename T> \
+    void NDNBOOST_PP_CAT(name, _msvc_impl) \
+    ( ::ndnboost::mpl::false_, const T& t NDNBOOST_IOSTREAMS_PUSH_PARAMS() ) \
+    { this->helper( ::ndnboost::iostreams::detail::resolve<mode, ch>(t) \
+                    NDNBOOST_IOSTREAMS_PUSH_ARGS() ); } \
+    template<typename T> \
+    NDNBOOST_PP_IF(has_return, result, explicit) \
+    name(const T& t NDNBOOST_IOSTREAMS_PUSH_PARAMS()) \
+    { \
+        this->NDNBOOST_PP_CAT(name, _msvc_impl) \
+              ( ::ndnboost::iostreams::detail::is_pipeline<T>(), \
+                t NDNBOOST_IOSTREAMS_PUSH_ARGS() ); \
+    } \
+    /**/
+#endif // #if VC6, VC7.0, Borland 5.x
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_PUSH_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/push_params.hpp b/include/ndnboost/iostreams/detail/push_params.hpp
new file mode 100644
index 0000000..bbb214c
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/push_params.hpp
@@ -0,0 +1,21 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_PUSH_PARAMS_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_PUSH_PARAMS_HPP_INCLUDED 
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif                    
+
+#define NDNBOOST_IOSTREAMS_PUSH_PARAMS() \
+    , std::streamsize buffer_size = -1 , std::streamsize pback_size = -1 \
+    /**/
+
+#define NDNBOOST_IOSTREAMS_PUSH_ARGS() , buffer_size, pback_size     
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_PUSH_PARAMS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/resolve.hpp b/include/ndnboost/iostreams/detail/resolve.hpp
new file mode 100644
index 0000000..1d0fa56
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/resolve.hpp
@@ -0,0 +1,235 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_RESOLVE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_RESOLVE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp> // partial spec, put size_t in std.
+#include <cstddef>          // std::size_t.
+#include <ndnboost/detail/is_incrementable.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/adapter/mode_adapter.hpp>
+#include <ndnboost/iostreams/detail/adapter/output_iterator_adapter.hpp>
+#include <ndnboost/iostreams/detail/adapter/range_adapter.hpp>
+#include <ndnboost/iostreams/detail/config/gcc.hpp>
+#include <ndnboost/iostreams/detail/config/overload_resolution.hpp>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#include <ndnboost/iostreams/detail/enable_if_stream.hpp>
+#include <ndnboost/iostreams/detail/is_dereferenceable.hpp>
+#include <ndnboost/iostreams/detail/is_iterator_range.hpp>
+#include <ndnboost/iostreams/detail/select.hpp>
+#include <ndnboost/iostreams/detail/wrap_unwrap.hpp>
+#include <ndnboost/iostreams/device/array.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/mpl/and.hpp>
+#include <ndnboost/mpl/bool.hpp> // true_.
+#include <ndnboost/mpl/if.hpp>
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300)
+# include <ndnboost/range/iterator_range.hpp>
+#endif // #if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300)
+#include <ndnboost/type_traits/is_array.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp> // VC7.1 C4224.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+//------------------Definition of resolve-------------------------------------//
+
+#ifndef NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //-------------------------//
+
+template<typename Mode, typename Ch, typename T>
+struct resolve_traits {
+    typedef typename 
+            mpl::if_<
+                ndnboost::detail::is_incrementable<T>,
+                output_iterator_adapter<Mode, Ch, T>,
+                const T&
+            >::type type;
+};
+
+# ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-------------------------------//
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type
+resolve( const T& t 
+         NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T)
+
+         // I suspect that the compilers which require this workaround may
+         // be correct, but I'm not sure why :(
+         #if NDNBOOST_WORKAROUND(NDNBOOST_INTEL_CXX_VERSION, NDNBOOST_TESTED_AT(810)) ||\
+             NDNBOOST_WORKAROUND(__MWERKS__, NDNBOOST_TESTED_AT(0x3205)) || \
+             NDNBOOST_WORKAROUND(NDNBOOST_IOSTREAMS_GCC, NDNBOOST_TESTED_AT(400)) ||\
+             NDNBOOST_WORKAROUND(__IBMCPP__, NDNBOOST_TESTED_AT(1110))
+             /**/
+         , typename disable_if< is_iterator_range<T> >::type* = 0
+         #endif
+         )
+{
+    typedef typename resolve_traits<Mode, Ch, T>::type return_type;
+    return return_type(t);
+}
+
+template<typename Mode, typename Ch, typename Tr>
+mode_adapter< Mode, std::basic_streambuf<Ch, Tr> > 
+resolve(std::basic_streambuf<Ch, Tr>& sb)
+{ return mode_adapter< Mode, std::basic_streambuf<Ch, Tr> >(wrap(sb)); }
+
+template<typename Mode, typename Ch, typename Tr>
+mode_adapter< Mode, std::basic_istream<Ch, Tr> > 
+resolve(std::basic_istream<Ch, Tr>& is)
+{ return mode_adapter< Mode, std::basic_istream<Ch, Tr> >(wrap(is)); }
+
+template<typename Mode, typename Ch, typename Tr>
+mode_adapter< Mode, std::basic_ostream<Ch, Tr> > 
+resolve(std::basic_ostream<Ch, Tr>& os)
+{ return mode_adapter< Mode, std::basic_ostream<Ch, Tr> >(wrap(os)); }
+
+template<typename Mode, typename Ch, typename Tr>
+mode_adapter< Mode, std::basic_iostream<Ch, Tr> > 
+resolve(std::basic_iostream<Ch, Tr>& io)
+{ return mode_adapter< Mode, std::basic_iostream<Ch, Tr> >(wrap(io)); }
+
+template<typename Mode, typename Ch, std::size_t N>
+array_adapter<Mode, Ch> resolve(Ch (&array)[N])
+{ return array_adapter<Mode, Ch>(array); }
+
+#  if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300)
+    template<typename Mode, typename Ch, typename Iter>
+    range_adapter< Mode, ndnboost::iterator_range<Iter> > 
+    resolve(const ndnboost::iterator_range<Iter>& rng)
+    { return range_adapter< Mode, ndnboost::iterator_range<Iter> >(rng); }
+#  endif // #if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300)
+
+# else // # ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //---------------------//
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type
+resolve( const T& t 
+         NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T)
+         #if defined(__GNUC__)
+         , typename disable_if< is_iterator_range<T> >::type* = 0
+         #endif
+         )
+{
+    typedef typename resolve_traits<Mode, Ch, T>::type return_type;
+    return return_type(t);
+}
+
+template<typename Mode, typename Ch>
+mode_adapter<Mode, std::streambuf> 
+resolve(std::streambuf& sb) 
+{ return mode_adapter<Mode, std::streambuf>(wrap(sb)); }
+
+template<typename Mode, typename Ch>
+mode_adapter<Mode, std::istream> 
+resolve(std::istream& is)
+{ return mode_adapter<Mode, std::istream>(wrap(is)); }
+
+template<typename Mode, typename Ch>
+mode_adapter<Mode, std::ostream> 
+resolve(std::ostream& os)
+{ return mode_adapter<Mode, std::ostream>(wrap(os)); }
+
+template<typename Mode, typename Ch>
+mode_adapter<Mode, std::iostream> 
+resolve(std::iostream& io)
+{ return mode_adapter<Mode, std::iostream>(wrap(io)); }
+
+template<typename Mode, typename Ch, std::size_t N>
+array_adapter<Mode, Ch> resolve(Ch (&array)[N])
+{ return array_adapter<Mode, Ch>(array); }
+
+template<typename Mode, typename Ch, typename Iter>
+range_adapter< Mode, ndnboost::iterator_range<Iter> > 
+resolve(const ndnboost::iterator_range<Iter>& rng)
+{ return range_adapter< Mode, ndnboost::iterator_range<Iter> >(rng); }
+
+# endif // # ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------//
+#else // #ifndef NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //----------------//
+
+template<typename Mode, typename Ch, typename T>
+struct resolve_traits {
+    // Note: test for is_iterator_range must come before test for output
+    // iterator.
+    typedef typename 
+            iostreams::select<  // Disambiguation for Tru64.
+                is_std_io<T>,
+                mode_adapter<Mode, T>,
+                is_iterator_range<T>,
+                range_adapter<Mode, T>,
+                is_dereferenceable<T>,
+                output_iterator_adapter<Mode, Ch, T>,
+                is_array<T>,
+                array_adapter<Mode, T>,
+                else_,
+                #if !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600)
+                    const T&
+                #else
+                    T
+                #endif
+            >::type type;
+};
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type 
+resolve(const T& t, mpl::true_)
+{   // Bad overload resolution.
+    typedef typename resolve_traits<Mode, Ch, T>::type return_type;
+    return return_type(wrap(const_cast<T&>(t)));
+}
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type 
+resolve(const T& t, mpl::false_)
+{ 
+    typedef typename resolve_traits<Mode, Ch, T>::type return_type;
+    return return_type(t);
+}
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type 
+resolve(const T& t NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T))
+{ return resolve<Mode, Ch>(t, is_std_io<T>()); }
+
+# if !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
+     !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) && \
+     !defined(__GNUC__) // ---------------------------------------------------//
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type 
+resolve(T& t, mpl::true_)
+{ 
+    typedef typename resolve_traits<Mode, Ch, T>::type return_type;
+    return return_type(wrap(t));
+}
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type 
+resolve(T& t, mpl::false_)
+{ 
+    typedef typename resolve_traits<Mode, Ch, T>::type return_type;
+    return return_type(t);
+}
+
+template<typename Mode, typename Ch, typename T>
+typename resolve_traits<Mode, Ch, T>::type 
+resolve(T& t NDNBOOST_IOSTREAMS_ENABLE_IF_STREAM(T))
+{ return resolve<Mode, Ch>(t, is_std_io<T>()); }
+
+# endif // Borland 5.x, VC6-7.0 or GCC 2.9x //--------------------------------//
+#endif // #ifndef NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //---------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp> // VC7.1 4224.
+
+#endif // NDNBOOST_IOSTREAMS_DETAIL_RESOLVE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/restrict_impl.hpp b/include/ndnboost/iostreams/detail/restrict_impl.hpp
new file mode 100644
index 0000000..a33047a
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/restrict_impl.hpp
@@ -0,0 +1,482 @@
+/*
+ * Distributed under the Boost Software License, Version 1.0.(See accompanying 
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+ * 
+ * See http://www.boost.org/libs/iostreams for documentation.
+
+ * File:        ndnboost/iostreams/detail/restrict_impl.hpp
+ * Date:        Sun Jan 06 12:57:30 MST 2008
+ * Copyright:   2007-2008 CodeRage, LLC
+ * Author:      Jonathan Turkanis
+ * Contact:     turkanis at coderage dot com
+ *
+ * If included with the macro NDNBOOST_IOSTREAMS_RESTRICT undefined, defines the 
+ * class template ndnboost::iostreams::restriction. If included with the macro
+ * NDNBOOST_IOSTREAMS_RESTRICT defined as an identifier, defines the overloaded
+ * function template ndnboost::iostreams::NDNBOOST_IOSTREAMS_RESTRICT, and object 
+ * generator for ndnboost::iostreams::restriction.
+ *
+ * This design allows <ndnboost/iostreams/restrict.hpp> and 
+ * <ndnboost/iostreams/slice.hpp> to share an implementation.
+ */
+
+#if !defined(NDNBOOST_IOSTREAMS_RESTRICT_IMPL_HPP_INCLUDED) && \
+    !defined(NDNBOOST_IOSTREAMS_RESTRICT)
+# define NDNBOOST_IOSTREAMS_RESTRICT_IMPL_HPP_INCLUDED
+                    
+//------------------Implementation of restriction-----------------------------//
+
+# include <algorithm>          // min.
+# include <utility>            // pair.
+# include <ndnboost/cstdint.hpp>  // intmax_t.
+# include <ndnboost/config.hpp>   // DEDUCED_TYPENAME.
+# include <ndnboost/iostreams/categories.hpp>
+# include <ndnboost/iostreams/char_traits.hpp>
+# include <ndnboost/iostreams/detail/adapter/device_adapter.hpp>
+# include <ndnboost/iostreams/detail/adapter/filter_adapter.hpp>
+# include <ndnboost/iostreams/detail/call_traits.hpp>
+# include <ndnboost/iostreams/detail/enable_if_stream.hpp>
+# include <ndnboost/iostreams/detail/error.hpp>
+# include <ndnboost/iostreams/detail/ios.hpp>     // failure.
+# include <ndnboost/iostreams/detail/select.hpp>
+# include <ndnboost/iostreams/operations.hpp>
+# include <ndnboost/iostreams/skip.hpp>
+# include <ndnboost/iostreams/traits.hpp>         // mode_of, is_direct.
+# include <ndnboost/mpl/bool.hpp>
+# include <ndnboost/static_assert.hpp>
+# include <ndnboost/throw_exception.hpp>
+# include <ndnboost/type_traits/is_convertible.hpp>
+
+# include <ndnboost/iostreams/detail/config/disable_warnings.hpp>
+
+namespace ndnboost { namespace iostreams {
+
+namespace detail {
+
+//
+// Template name: restricted_indirect_device.
+// Description: Provides an restricted view of an indirect Device.
+// Template parameters:
+//      Device - An indirect model of Device that models either Source or
+//          SeekableDevice.
+//
+template<typename Device>
+class restricted_indirect_device : public device_adapter<Device> {
+private:
+    typedef typename detail::param_type<Device>::type  param_type;
+public:
+    typedef typename char_type_of<Device>::type  char_type;
+    typedef typename mode_of<Device>::type       mode;
+    NDNBOOST_STATIC_ASSERT(!(is_convertible<mode, detail::two_sequence>::value));
+    struct category
+        : mode,
+          device_tag,
+          closable_tag,
+          flushable_tag,
+          localizable_tag,
+          optimally_buffered_tag
+        { };
+    restricted_indirect_device( param_type dev, stream_offset off,
+                                stream_offset len = -1 );
+    std::streamsize read(char_type* s, std::streamsize n);
+    std::streamsize write(const char_type* s, std::streamsize n);
+    std::streampos seek(stream_offset off, NDNBOOST_IOS::seekdir way);
+private:
+    stream_offset beg_, pos_, end_;
+};
+
+//
+// Template name: restricted_direct_device.
+// Description: Provides an restricted view of a Direct Device.
+// Template parameters:
+//      Device - A model of Direct and Device.
+//
+template<typename Device>
+class restricted_direct_device : public device_adapter<Device> {
+public:
+    typedef typename char_type_of<Device>::type  char_type;
+    typedef std::pair<char_type*, char_type*>    pair_type;
+    typedef typename mode_of<Device>::type       mode;
+    NDNBOOST_STATIC_ASSERT(!(is_convertible<mode, detail::two_sequence>::value));
+    struct category
+        : mode_of<Device>::type,
+          device_tag,
+          direct_tag,
+          closable_tag,
+          localizable_tag
+        { };
+    restricted_direct_device( const Device& dev, stream_offset off,
+                              stream_offset len = -1 );
+    pair_type input_sequence();
+    pair_type output_sequence();
+private:
+    pair_type sequence(mpl::true_);
+    pair_type sequence(mpl::false_);
+    char_type *beg_, *end_;
+};
+
+//
+// Template name: restricted_filter.
+// Description: Provides an restricted view of a Filter.
+// Template parameters:
+//      Filter - An indirect model of Filter.
+//
+template<typename Filter>
+class restricted_filter : public filter_adapter<Filter> {
+public:
+    typedef typename char_type_of<Filter>::type char_type;
+    typedef typename mode_of<Filter>::type      mode;
+    NDNBOOST_STATIC_ASSERT(!(is_convertible<mode, detail::two_sequence>::value));
+    struct category
+        : mode,
+          filter_tag,
+          multichar_tag,
+          closable_tag,
+          localizable_tag,
+          optimally_buffered_tag
+        { };
+    restricted_filter( const Filter& flt, stream_offset off, 
+                       stream_offset len = -1 );
+
+    template<typename Source>
+    std::streamsize read(Source& src, char_type* s, std::streamsize n)
+    {
+        using namespace std;
+        if (!open_)
+            open(src, NDNBOOST_IOS::in);
+        std::streamsize amt =
+            end_ != -1 ?
+                (std::min) (n, static_cast<std::streamsize>(end_ - pos_)) :
+                n;
+        std::streamsize result = 
+            iostreams::read(this->component(), src, s, amt);
+        if (result != -1)
+            pos_ += result;
+        return result;
+    }
+
+    template<typename Sink>
+    std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
+    {
+        if (!open_)
+            open(snk, NDNBOOST_IOS::out);
+        if (end_ != -1 && pos_ + n >= end_) {
+            if(pos_ < end_)
+                pos_ += iostreams::write(this->component(),
+                    snk, s, end_ - pos_);
+            ndnboost::throw_exception(bad_write());
+        }
+        std::streamsize result = 
+            iostreams::write(this->component(), snk, s, n);
+        pos_ += result;
+        return result;
+    }
+
+    template<typename Device>
+    std::streampos seek(Device& dev, stream_offset off, NDNBOOST_IOS::seekdir way)
+    {
+        stream_offset next;
+        if (way == NDNBOOST_IOS::beg) {
+            next = beg_ + off;
+        } else if (way == NDNBOOST_IOS::cur) {
+            next = pos_ + off;
+        } else if (end_ != -1) {
+            next = end_ + off;
+        } else {
+            // Restriction is half-open; seek relative to the actual end.
+            pos_ = this->component().seek(dev, off, NDNBOOST_IOS::end);
+            if (pos_ < beg_)
+                ndnboost::throw_exception(bad_seek());
+            return offset_to_position(pos_ - beg_);
+        }
+        if (next < beg_ || (end_ != -1 && next >= end_))
+            ndnboost::throw_exception(bad_seek());
+        pos_ = this->component().seek(dev, next, NDNBOOST_IOS::cur);
+        return offset_to_position(pos_ - beg_);
+    }
+
+    template<typename Device>
+    void close(Device& dev) 
+    { 
+        open_ = false;
+        detail::close_all(this->component(), dev); 
+    }
+
+    template<typename Device>
+    void close(Device& dev, NDNBOOST_IOS::openmode which) 
+    { 
+        open_ = false;
+        iostreams::close(this->component(), dev, which); 
+    }
+private:
+    template<typename Device>
+    void open(Device& dev, NDNBOOST_IOS::openmode which)
+    {
+        typedef typename is_convertible<mode, dual_use>::type is_dual_use;
+        open_ = true;
+        which = is_dual_use() ? which : (NDNBOOST_IOS::in | NDNBOOST_IOS::out);
+        iostreams::skip(this->component(), dev, beg_, which);
+    }
+
+    stream_offset  beg_, pos_, end_;
+    bool           open_;
+};
+
+template<typename T>
+struct restriction_traits
+    : iostreams::select<  // Disambiguation for Tru64.
+          is_filter<T>,  restricted_filter<T>,
+          is_direct<T>,  restricted_direct_device<T>,
+          else_,         restricted_indirect_device<T>
+      >
+    { };
+
+} // End namespace detail.
+
+template<typename T>
+struct restriction : public detail::restriction_traits<T>::type {
+    typedef typename detail::param_type<T>::type          param_type;
+    typedef typename detail::restriction_traits<T>::type  base_type;
+    restriction(param_type t, stream_offset off, stream_offset len = -1)
+        : base_type(t, off, len)
+        { }
+};
+
+namespace detail {
+
+//--------------Implementation of restricted_indirect_device------------------//
+
+template<typename Device>
+restricted_indirect_device<Device>::restricted_indirect_device
+    (param_type dev, stream_offset off, stream_offset len)
+    : device_adapter<Device>(dev), beg_(off), pos_(off), 
+      end_(len != -1 ? off + len : -1)
+{
+    if (len < -1 || off < 0)
+        ndnboost::throw_exception(NDNBOOST_IOSTREAMS_FAILURE("bad offset"));
+    iostreams::skip(this->component(), off);
+}
+
+template<typename Device>
+inline std::streamsize restricted_indirect_device<Device>::read
+    (char_type* s, std::streamsize n)
+{
+    using namespace std;
+    std::streamsize amt =
+        end_ != -1 ?
+            (std::min) (n, static_cast<std::streamsize>(end_ - pos_)) :
+            n;
+    std::streamsize result = iostreams::read(this->component(), s, amt);
+    if (result != -1)
+        pos_ += result;
+    return result;
+}
+
+template<typename Device>
+inline std::streamsize restricted_indirect_device<Device>::write
+    (const char_type* s, std::streamsize n)
+{
+    if (end_ != -1 && pos_ + n >= end_) {
+        if(pos_ < end_)
+            pos_ += iostreams::write(this->component(), s, end_ - pos_);
+        ndnboost::throw_exception(bad_write());
+    }
+    std::streamsize result = iostreams::write(this->component(), s, n);
+    pos_ += result;
+    return result;
+}
+
+template<typename Device>
+std::streampos restricted_indirect_device<Device>::seek
+    (stream_offset off, NDNBOOST_IOS::seekdir way)
+{
+    stream_offset next;
+    if (way == NDNBOOST_IOS::beg) {
+        next = beg_ + off;
+    } else if (way == NDNBOOST_IOS::cur) {
+        next = pos_ + off;
+    } else if (end_ != -1) {
+        next = end_ + off;
+    } else {
+        // Restriction is half-open; seek relative to the actual end.
+        pos_ = iostreams::seek(this->component(), off, NDNBOOST_IOS::end);
+        if (pos_ < beg_)
+            ndnboost::throw_exception(bad_seek());
+        return offset_to_position(pos_ - beg_);
+    }
+    if (next < beg_ || (end_ != -1 && next > end_))
+        ndnboost::throw_exception(bad_seek());
+    pos_ = iostreams::seek(this->component(), next - pos_, NDNBOOST_IOS::cur);
+    return offset_to_position(pos_ - beg_);
+}
+
+//--------------Implementation of restricted_direct_device--------------------//
+
+template<typename Device>
+restricted_direct_device<Device>::restricted_direct_device
+    (const Device& dev, stream_offset off, stream_offset len)
+    : device_adapter<Device>(dev), beg_(0), end_(0)
+{
+    std::pair<char_type*, char_type*> seq =
+        sequence(is_convertible<category, input>());
+    if ( off < 0 || len < -1 || 
+         (len != -1 && off + len > seq.second - seq.first) )
+    {
+        ndnboost::throw_exception(NDNBOOST_IOSTREAMS_FAILURE("bad offset"));
+    }
+    beg_ = seq.first + off;
+    end_ = len != -1 ? 
+        seq.first + off + len :
+        seq.second;
+}
+
+template<typename Device>
+typename restricted_direct_device<Device>::pair_type
+restricted_direct_device<Device>::input_sequence()
+{
+    NDNBOOST_STATIC_ASSERT((is_convertible<category, input>::value));
+    return std::make_pair(beg_, end_);
+}
+
+template<typename Device>
+typename restricted_direct_device<Device>::pair_type
+restricted_direct_device<Device>::output_sequence()
+{
+    NDNBOOST_STATIC_ASSERT((is_convertible<category, output>::value));
+    return std::make_pair(beg_, end_);
+}
+
+template<typename Device>
+typename restricted_direct_device<Device>::pair_type
+restricted_direct_device<Device>::sequence(mpl::true_)
+{ return iostreams::input_sequence(this->component()); }
+
+template<typename Device>
+typename restricted_direct_device<Device>::pair_type
+restricted_direct_device<Device>::sequence(mpl::false_)
+{ return iostreams::output_sequence(this->component()); }
+
+//--------------Implementation of restricted_filter---------------------------//
+
+template<typename Filter>
+restricted_filter<Filter>::restricted_filter
+    (const Filter& flt, stream_offset off, stream_offset len)
+    : filter_adapter<Filter>(flt), beg_(off),
+      pos_(off), end_(len != -1 ? off + len : -1), open_(false)
+{
+    if (len < -1 || off < 0)
+        ndnboost::throw_exception(NDNBOOST_IOSTREAMS_FAILURE("bad offset"));
+}
+
+} // End namespace detail.
+
+} } // End namespaces iostreams, boost.
+
+#elif defined(NDNBOOST_IOSTREAMS_RESTRICT)
+
+namespace ndnboost { namespace iostreams {
+
+//--------------Implementation of restrict/slice------------------------------//
+
+// Note: The following workarounds are patterned after resolve.hpp. It has not
+// yet been confirmed that they are necessary.
+
+# ifndef NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //------------------------//
+#  ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //------------------------------//
+
+template<typename T>
+restriction<T> 
+NDNBOOST_IOSTREAMS_RESTRICT( const T& t, stream_offset off, stream_offset len = -1
+                          NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
+{ return restriction<T>(t, off, len); }
+
+template<typename Ch, typename Tr>
+restriction< std::basic_streambuf<Ch, Tr> >
+NDNBOOST_IOSTREAMS_RESTRICT( std::basic_streambuf<Ch, Tr>& sb, stream_offset off, 
+                          stream_offset len = -1 )
+{ return restriction< std::basic_streambuf<Ch, Tr> >(sb, off, len); }
+
+template<typename Ch, typename Tr>
+restriction< std::basic_istream<Ch, Tr> >
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::basic_istream<Ch, Tr>& is, stream_offset off, stream_offset len = -1)
+{ return restriction< std::basic_istream<Ch, Tr> >(is, off, len); }
+
+template<typename Ch, typename Tr>
+restriction< std::basic_ostream<Ch, Tr> >
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::basic_ostream<Ch, Tr>& os, stream_offset off, stream_offset len = -1)
+{ return restriction< std::basic_ostream<Ch, Tr> >(os, off, len); }
+
+template<typename Ch, typename Tr>
+restriction< std::basic_iostream<Ch, Tr> >
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::basic_iostream<Ch, Tr>& io, stream_offset off, stream_offset len = -1)
+{ return restriction< std::basic_iostream<Ch, Tr> >(io, off, len); }
+
+#  else // # ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------//
+
+template<typename T>
+restriction<T> 
+NDNBOOST_IOSTREAMS_RESTRICT( const T& t, stream_offset off, stream_offset len = -1
+                          NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
+{ return restriction<T>(t, off, len); }
+
+restriction<std::streambuf> 
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::streambuf& sb, stream_offset off, stream_offset len = -1)
+{ return restriction<std::streambuf>(sb, off, len); }
+
+restriction<std::istream> 
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::istream<Ch, Tr>& is, stream_offset off, stream_offset len = -1)
+{ return restriction<std::istream>(is, off, len); }
+
+restriction<std::ostream> 
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::ostream<Ch, Tr>& os, stream_offset off, stream_offset len = -1)
+{ return restriction<std::ostream>(os, off, len); }
+
+restriction<std::iostream> 
+NDNBOOST_IOSTREAMS_RESTRICT
+    (std::iostream<Ch, Tr>& io, stream_offset off, stream_offset len = -1)
+{ return restriction<std::iostream>(io, off, len); }
+
+#  endif // # ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-------------------//
+# else // #ifndef NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //---------------//
+
+template<typename T>
+restriction<T> 
+NDNBOOST_IOSTREAMS_RESTRICT
+    (const T& t, stream_offset off, stream_offset len, mpl::true_)
+{   // Bad overload resolution.
+    return restriction<T>(const_cast<T&>(t, off, len));
+}
+
+template<typename T>
+restriction<T> 
+NDNBOOST_IOSTREAMS_RESTRICT
+    (const T& t, stream_offset off, stream_offset len, mpl::false_)
+{ return restriction<T>(t, off, len); }
+
+template<typename T>
+restriction<T> 
+NDNBOOST_IOSTREAMS_RESTRICT( const T& t, stream_offset off, stream_offset len = -1
+                          NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
+{ return NDNBOOST_IOSTREAMS_RESTRICT(t, off, len, is_std_io<T>()); }
+
+# if !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
+     !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1300) && \
+     !defined(__GNUC__) // ---------------------------------------------------//
+
+template<typename T>
+restriction<T>
+NDNBOOST_IOSTREAMS_RESTRICT(T& t, stream_offset off, stream_offset len = -1)
+{ return restriction<T>(t, off, len); }
+
+#  endif // Borland 5.x, VC6-7.0 or GCC 2.9x //-------------------------------//
+# endif // #ifndef NDNBOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //--------------//
+
+} } // End namespaces iostreams, boost.
+
+#endif // #if !defined(NDNBOOST_IOSTREAMS_RESTRICT_IMPL_HPP_INCLUDED) ...
diff --git a/include/ndnboost/iostreams/detail/select.hpp b/include/ndnboost/iostreams/detail/select.hpp
new file mode 100644
index 0000000..c0753f6
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/select.hpp
@@ -0,0 +1,86 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Contains the metafunction select, which mimics the effect of a chain of
+// nested mpl if_'s.
+//
+// -----------------------------------------------------------------------------
+//
+// Usage:
+//      
+// typedef typename select<
+//                      case1,  type1,
+//                      case2,  type2,
+//                      ...
+//                      true_,  typen
+//                  >::type selection;
+//
+// Here case1, case2, ... are models of MPL::IntegralConstant with value type
+// bool, and n <= 12.
+
+#ifndef NDNBOOST_IOSTREAMS_SELECT_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_SELECT_HPP_INCLUDED   
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif                  
+ 
+#include <ndnboost/type_traits/is_base_and_derived.hpp>
+#include <ndnboost/mpl/eval_if.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/void.hpp>
+
+namespace ndnboost { namespace iostreams { 
+
+typedef mpl::true_ else_;
+
+template< typename Case1 = mpl::true_,
+          typename Type1 = mpl::void_,
+          typename Case2 = mpl::true_,
+          typename Type2 = mpl::void_,
+          typename Case3 = mpl::true_,
+          typename Type3 = mpl::void_,
+          typename Case4 = mpl::true_,
+          typename Type4 = mpl::void_,
+          typename Case5 = mpl::true_,
+          typename Type5 = mpl::void_,
+          typename Case6 = mpl::true_,
+          typename Type6 = mpl::void_,
+          typename Case7 = mpl::true_,
+          typename Type7 = mpl::void_,
+          typename Case8 = mpl::true_,
+          typename Type8 = mpl::void_,
+          typename Case9 = mpl::true_,
+          typename Type9 = mpl::void_,
+          typename Case10 = mpl::true_,
+          typename Type10 = mpl::void_,
+          typename Case11 = mpl::true_,
+          typename Type11 = mpl::void_,
+          typename Case12 = mpl::true_,
+          typename Type12 = mpl::void_ >
+struct select {
+    typedef typename
+            mpl::eval_if<
+                Case1, mpl::identity<Type1>, mpl::eval_if<
+                Case2, mpl::identity<Type2>, mpl::eval_if<
+                Case3, mpl::identity<Type3>, mpl::eval_if<
+                Case4, mpl::identity<Type4>, mpl::eval_if<
+                Case5, mpl::identity<Type5>, mpl::eval_if<
+                Case6, mpl::identity<Type6>, mpl::eval_if<
+                Case7, mpl::identity<Type7>, mpl::eval_if<
+                Case8, mpl::identity<Type8>, mpl::eval_if<
+                Case9, mpl::identity<Type9>, mpl::eval_if<
+                Case10, mpl::identity<Type10>, mpl::eval_if<
+                Case11, mpl::identity<Type11>, mpl::if_<
+                Case12, Type12, mpl::void_ > > > > > > > > > > >
+            >::type type;
+};
+
+} } // End namespaces iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_SELECT_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/select_by_size.hpp b/include/ndnboost/iostreams/detail/select_by_size.hpp
new file mode 100644
index 0000000..8a02771
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/select_by_size.hpp
@@ -0,0 +1,161 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2004-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+//
+// Intended as an alternative to type_traits::yes_type and type_traits::no_type.
+// Provides an arbitrary number of types (case_<0>, case_<1>, ...) for
+// determining the results of overload resultion using 'sizeof', plus a uniform
+// means of using the result. yes_type and no_type are typedefs for case_<1>
+// and case_<0>. A single case with negative argument, case_<-1>, is also 
+// provided, for convenience.
+//
+// This header may be included any number of times, with
+// NDNBOOST_SELECT_BY_SIZE_MAX_CASE defined to be the largest N such that case_<N>
+// is needed for a particular application. It defaults to 20.
+//
+// This header depends only on Boost.Config and Boost.Preprocessor. Dependence
+// on Type Traits or MPL was intentionally avoided, to leave open the 
+// possibility that select_by_size could be used by these libraries.
+//
+// Example usage:
+//
+//    #define NDNBOOST_SELECT_BY_SIZE_MAX_CASE 7   // (Needed when default was 2)
+//    #include <ndnboost/utility/select_by_size.hpp>
+//
+//    using namespace ndnboost::utility;
+//
+//    case_<0> helper(bool);
+//    case_<1> helper(int);
+//    case_<2> helper(unsigned);
+//    case_<3> helper(long);
+//    case_<4> helper(unsigned long);
+//    case_<5> helper(float);
+//    case_<6> helper(double);
+//    case_<7> helper(const char*);
+//
+//    struct test {
+//        static const int value =
+//            select_by_size< sizeof(helper(9876UL)) >::value;
+//        NDNBOOST_STATIC_ASSERT(value == 4);
+//    };
+//
+// For compilers with integral constant expression problems, e.g. Borland 5.x,
+// one can also write
+//
+//    struct test {
+//        NDNBOOST_SELECT_BY_SIZE(int, value, helper(9876UL));
+//    };
+//
+// to define a static integral constant 'value' equal to
+//
+//    select_by_size< sizeof(helper(9876UL)) >::value.
+//
+
+// Include guards surround all contents of this header except for explicit
+// specializations of select_by_size for case_<N> with N > 2.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_SELECT_BY_SIZE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_SELECT_BY_SIZE_HPP_INCLUDED
+
+// The lowest N for which select_by_size< sizeof(case_<N>) > has not been
+// specialized.
+#define SELECT_BY_SIZE_MAX_SPECIALIZED 20
+
+#include <ndnboost/config.hpp>    // NDNBOOST_STATIC_CONSTANT.
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/iteration/local.hpp>
+
+/* Alternative implementation using max_align. 
+
+#include <ndnboost/type_traits/alignment_of.hpp>
+#include <ndnboost/type_traits/type_with_alignment.hpp>
+
+namespace ndnboost { namespace utility {
+
+template<int N>
+struct case_ { char c[(N + 1) * alignment_of<detail::max_align>::value]; };
+
+template<unsigned Size>
+struct select_by_size {
+    NDNBOOST_STATIC_CONSTANT(int, value = 
+        (Size / alignment_of<detail::max_align>::value - 1));
+};
+
+} } // End namespaces utility, boost.
+
+*/              // End alternate implementation.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+//--------------Definition of case_-------------------------------------------//
+
+template<int N> struct case_ { char c1; case_<N - 1> c2; };
+template<> struct case_<-1> { char c; };
+typedef case_<true> yes_type;
+typedef case_<false> no_type;
+
+//--------------Declaration of select_by_size---------------------------------//
+
+template<unsigned Size> struct select_by_size;
+
+} } } // End namespaces detail, iostreams, boost.
+
+//--------------Definition of SELECT_BY_SIZE_SPEC-----------------------------//
+
+// Sepecializes select_by_size for sizeof(case<n-1>). The decrement is used
+// here because the preprocessor library doesn't handle negative integers.
+#define SELECT_BY_SIZE_SPEC(n) \
+    namespace ndnboost { namespace iostreams { namespace detail { \
+      static const int NDNBOOST_PP_CAT(sizeof_case_, n) = sizeof(case_<n - 1>); \
+      template<> \
+      struct select_by_size< NDNBOOST_PP_CAT(sizeof_case_, n) > { \
+          struct type { NDNBOOST_STATIC_CONSTANT(int, value = n - 1); }; \
+          NDNBOOST_STATIC_CONSTANT(int, value = type::value); \
+      }; \
+    } } } \
+    /**/
+
+//--------------Default specializations of select_by_size---------------------//
+
+#define NDNBOOST_PP_LOCAL_MACRO(n) SELECT_BY_SIZE_SPEC(n)
+#define NDNBOOST_PP_LOCAL_LIMITS (0, 20)
+#include NDNBOOST_PP_LOCAL_ITERATE()
+#undef NDNBOOST_PP_LOCAL_MACRO
+
+//--------------Definition of SELECT_BY_SIZE----------------------------------//
+
+#define NDNBOOST_SELECT_BY_SIZE(type_, name, expr) \
+    NDNBOOST_STATIC_CONSTANT( \
+        unsigned, \
+        NDNBOOST_PP_CAT(boost_select_by_size_temp_, name) = sizeof(expr) \
+    ); \
+    NDNBOOST_STATIC_CONSTANT( \
+        type_, \
+        name = \
+            ( ::ndnboost::iostreams::detail::select_by_size< \
+                NDNBOOST_PP_CAT(boost_select_by_size_temp_, name) \
+              >::value ) \
+    ) \
+    /**/
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_SELECT_BY_SIZE_HPP_INCLUDED
+
+//----------Specializations of SELECT_BY_SIZE (outside main inclued guards)---//
+
+#if defined(NDNBOOST_SELECT_BY_SIZE_MAX_CASE) && \
+    NDNBOOST_SELECT_BY_SIZE_MAX_CASE > SELECT_BY_SIZE_MAX_SPECIALIZED
+
+#define NDNBOOST_PP_LOCAL_MACRO(n) SELECT_BY_SIZE_SPEC(n)
+#define NDNBOOST_PP_LOCAL_LIMITS \
+    (SELECT_BY_SIZE_MAX_SPECIALIZED, NDNBOOST_SELECT_BY_SIZE_MAX_CASE) \
+    /**/
+#include NDNBOOST_PP_LOCAL_ITERATE()
+#undef NDNBOOST_PP_LOCAL_MACRO
+#undef SELECT_BY_SIZE_MAX_SPECIALIZED
+#define SELECT_BY_SIZE_MAX_SPECIALIZED NDNBOOST_SELECT_BY_SIZE_MAX_CASE
+
+#endif
diff --git a/include/ndnboost/iostreams/detail/streambuf.hpp b/include/ndnboost/iostreams/detail/streambuf.hpp
new file mode 100644
index 0000000..d499332
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/streambuf.hpp
@@ -0,0 +1,34 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_STREAMBUF_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_STREAMBUF_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+                 
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# include <streambuf>
+#else 
+# include <streambuf.h>
+#endif 
+
+#ifndef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+# define NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(ch, tr) std::basic_streambuf< ch, tr >
+# define NDNBOOST_IOSTREAMS_PUBSYNC pubsync
+# define NDNBOOST_IOSTREAMS_PUBSEEKOFF pubseekoff
+# define NDNBOOST_IOSTREAMS_PUBSEEKPOS pubseekpos
+#else
+# define NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(ch, tr) std::streambuf
+# define NDNBOOST_IOSTREAMS_PUBSYNC sync
+# define NDNBOOST_IOSTREAMS_PUBSEEKOFF seekoff
+# define NDNBOOST_IOSTREAMS_PUBSEEKPOS seekpos
+#endif
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_STREAMBUF_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/streambuf/chainbuf.hpp b/include/ndnboost/iostreams/detail/streambuf/chainbuf.hpp
new file mode 100644
index 0000000..157b855
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/streambuf/chainbuf.hpp
@@ -0,0 +1,116 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_CHAINBUF_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_CHAINBUF_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif      
+
+#include <ndnboost/config.hpp>                    // NDNBOOST_MSVC, template friends.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/chain.hpp>
+#include <ndnboost/iostreams/detail/access_control.hpp>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#include <ndnboost/iostreams/detail/streambuf.hpp>
+#include <ndnboost/iostreams/detail/streambuf/linked_streambuf.hpp>
+#include <ndnboost/iostreams/detail/translate_int_type.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/noncopyable.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+//--------------Definition of chainbuf----------------------------------------//
+
+//
+// Template name: chainbuf.
+// Description: Stream buffer which operates by delegating to the first
+//      linked_streambuf in a chain.
+// Template parameters:
+//      Chain - The chain type.
+//
+template<typename Chain, typename Mode, typename Access>
+class chainbuf
+    : public NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(
+                 typename Chain::char_type,
+                 typename Chain::traits_type
+             ),
+      public access_control<typename Chain::client_type, Access>,
+      private noncopyable
+{
+private:
+    typedef access_control<chain_client<Chain>, Access>      client_type;
+public:
+    typedef typename Chain::char_type                        char_type;
+    NDNBOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(typename Chain::traits_type)
+protected:
+    typedef linked_streambuf<char_type, traits_type>         delegate_type;
+    chainbuf() { client_type::set_chain(&chain_); }
+    int_type underflow() 
+        { sentry t(this); return translate(delegate().underflow()); }
+    int_type pbackfail(int_type c)
+        { sentry t(this); return translate(delegate().pbackfail(c)); }
+    std::streamsize xsgetn(char_type* s, std::streamsize n)
+        { sentry t(this); return delegate().xsgetn(s, n); }
+    int_type overflow(int_type c)
+        { sentry t(this); return translate(delegate().overflow(c)); }
+    std::streamsize xsputn(const char_type* s, std::streamsize n)
+        { sentry t(this); return delegate().xsputn(s, n); }
+    int sync() { sentry t(this); return delegate().sync(); }
+    pos_type seekoff( off_type off, NDNBOOST_IOS::seekdir way,
+                      NDNBOOST_IOS::openmode which =
+                          NDNBOOST_IOS::in | NDNBOOST_IOS::out )
+        { sentry t(this); return delegate().seekoff(off, way, which); }
+    pos_type seekpos( pos_type sp,
+                      NDNBOOST_IOS::openmode which =
+                          NDNBOOST_IOS::in | NDNBOOST_IOS::out )
+        { sentry t(this); return delegate().seekpos(sp, which); }
+protected:
+    typedef NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(
+                 typename Chain::char_type,
+                 typename Chain::traits_type
+             )                                               base_type;
+//#if !NDNBOOST_WORKAROUND(__GNUC__, == 2)                                 
+//    NDNBOOST_IOSTREAMS_USING_PROTECTED_STREAMBUF_MEMBERS(base_type)
+//#endif
+private:
+
+    // Translate from std int_type to chain's int_type.
+    typedef NDNBOOST_IOSTREAMS_CHAR_TRAITS(char_type)           std_traits;
+    typedef typename Chain::traits_type                      chain_traits;
+    static typename chain_traits::int_type 
+    translate(typename std_traits::int_type c)
+        { return translate_int_type<std_traits, chain_traits>(c); }
+
+    delegate_type& delegate() 
+        { return static_cast<delegate_type&>(chain_.front()); }
+    void get_pointers()
+        {
+            this->setg(delegate().eback(), delegate().gptr(), delegate().egptr());
+            this->setp(delegate().pbase(), delegate().epptr());
+            this->pbump((int) (delegate().pptr() - delegate().pbase()));
+        }
+    void set_pointers()
+        {
+            delegate().setg(this->eback(), this->gptr(), this->egptr());
+            delegate().setp(this->pbase(), this->epptr());
+            delegate().pbump((int) (this->pptr() - this->pbase()));
+        }
+    struct sentry {
+        sentry(chainbuf<Chain, Mode, Access>* buf) : buf_(buf)
+            { buf_->set_pointers(); }
+        ~sentry() { buf_->get_pointers(); }
+        chainbuf<Chain, Mode, Access>* buf_;
+    };
+    friend struct sentry;
+    Chain chain_;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_CHAINBUF_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/streambuf/direct_streambuf.hpp b/include/ndnboost/iostreams/detail/streambuf/direct_streambuf.hpp
new file mode 100644
index 0000000..ec79604
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/streambuf/direct_streambuf.hpp
@@ -0,0 +1,313 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_DIRECT_STREAMBUF_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_DIRECT_STREAMBUF_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/assert.hpp>
+#include <cstddef>
+#include <typeinfo>
+#include <utility>                                 // pair.
+#include <ndnboost/config.hpp>                        // NDNBOOST_DEDUCED_TYPENAME, 
+#include <ndnboost/iostreams/detail/char_traits.hpp>  // member template friends.
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#include <ndnboost/iostreams/detail/error.hpp>
+#include <ndnboost/iostreams/detail/execute.hpp>
+#include <ndnboost/iostreams/detail/functional.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>
+#include <ndnboost/iostreams/detail/optional.hpp>
+#include <ndnboost/iostreams/detail/streambuf.hpp>
+#include <ndnboost/iostreams/detail/streambuf/linked_streambuf.hpp>
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/iostreams/positioning.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/throw_exception.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
+
+namespace ndnboost { namespace iostreams { 
+    
+namespace detail {
+
+template< typename T,
+          typename Tr = 
+              NDNBOOST_IOSTREAMS_CHAR_TRAITS(
+                 NDNBOOST_DEDUCED_TYPENAME char_type_of<T>::type 
+              ) >
+class direct_streambuf 
+    : public linked_streambuf<NDNBOOST_DEDUCED_TYPENAME char_type_of<T>::type, Tr>
+{
+public:
+    typedef typename char_type_of<T>::type                char_type;
+    NDNBOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr)
+private:
+    typedef linked_streambuf<char_type, traits_type>      base_type;
+    typedef typename category_of<T>::type                 category;
+    typedef NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(
+                char_type, traits_type
+            )                                             streambuf_type;
+public: // stream needs access.
+    void open(const T& t, std::streamsize buffer_size, 
+              std::streamsize pback_size);
+    bool is_open() const;
+    void close();
+    bool auto_close() const { return auto_close_; }
+    void set_auto_close(bool close) { auto_close_ = close; }
+    bool strict_sync() { return true; }
+
+    // Declared in linked_streambuf.
+    T* component() { return storage_.get(); }
+protected:
+#if !NDNBOOST_WORKAROUND(__GNUC__, == 2)
+    NDNBOOST_IOSTREAMS_USING_PROTECTED_STREAMBUF_MEMBERS(base_type)
+#endif
+    direct_streambuf();
+
+    //--------------Virtual functions-----------------------------------------//
+
+    // Declared in linked_streambuf.
+    void close_impl(NDNBOOST_IOS::openmode m);
+    const std::type_info& component_type() const { return typeid(T); }
+    void* component_impl() { return component(); } 
+#ifdef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+    public:
+#endif
+
+    // Declared in basic_streambuf.
+    int_type underflow();
+    int_type pbackfail(int_type c);
+    int_type overflow(int_type c);
+    pos_type seekoff( off_type off, NDNBOOST_IOS::seekdir way,
+                      NDNBOOST_IOS::openmode which );
+    pos_type seekpos(pos_type sp, NDNBOOST_IOS::openmode which);
+private:
+    pos_type seek_impl( stream_offset off, NDNBOOST_IOS::seekdir way,
+                        NDNBOOST_IOS::openmode which );
+    void init_input(any_tag) { }
+    void init_input(input);
+    void init_output(any_tag) { }
+    void init_output(output);
+    void init_get_area();
+    void init_put_area();
+    bool one_head() const;
+    bool two_head() const;
+    optional<T>  storage_;
+    char_type   *ibeg_, *iend_, *obeg_, *oend_;
+    bool         auto_close_;
+};
+                    
+//------------------Implementation of direct_streambuf------------------------//
+
+template<typename T, typename Tr>
+direct_streambuf<T, Tr>::direct_streambuf() 
+    : ibeg_(0), iend_(0), obeg_(0), oend_(0), auto_close_(true) 
+{ this->set_true_eof(true); }
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::open
+    (const T& t, std::streamsize, std::streamsize)
+{
+    storage_.reset(t);
+    init_input(category());
+    init_output(category());
+    setg(0, 0, 0);
+    setp(0, 0);
+    this->set_needs_close();
+}
+
+template<typename T, typename Tr>
+bool direct_streambuf<T, Tr>::is_open() const 
+{ return ibeg_ != 0 || obeg_ != 0; }
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::close() 
+{ 
+    base_type* self = this;
+    detail::execute_all( detail::call_member_close(*self, NDNBOOST_IOS::in),
+                         detail::call_member_close(*self, NDNBOOST_IOS::out),
+                         detail::call_reset(storage_) );
+}
+
+template<typename T, typename Tr>
+typename direct_streambuf<T, Tr>::int_type 
+direct_streambuf<T, Tr>::underflow()
+{
+    if (!ibeg_) 
+        ndnboost::throw_exception(cant_read());
+    if (!gptr()) 
+        init_get_area();
+    return gptr() != iend_ ? 
+        traits_type::to_int_type(*gptr()) : 
+        traits_type::eof();
+}
+
+template<typename T, typename Tr>
+typename direct_streambuf<T, Tr>::int_type 
+direct_streambuf<T, Tr>::pbackfail(int_type c)
+{
+    using namespace std;
+    if (!ibeg_) 
+        ndnboost::throw_exception(cant_read());
+    if (gptr() != 0 && gptr() != ibeg_) {
+        gbump(-1);
+        if (!traits_type::eq_int_type(c, traits_type::eof()))
+            *gptr() = traits_type::to_char_type(c);
+        return traits_type::not_eof(c);
+    }
+    ndnboost::throw_exception(bad_putback());
+}
+
+template<typename T, typename Tr>
+typename direct_streambuf<T, Tr>::int_type 
+direct_streambuf<T, Tr>::overflow(int_type c)
+{
+    using namespace std;
+    if (!obeg_)
+        ndnboost::throw_exception(NDNBOOST_IOSTREAMS_FAILURE("no write access"));
+    if (!pptr()) init_put_area();
+    if (!traits_type::eq_int_type(c, traits_type::eof())) {
+        if (pptr() == oend_)
+            ndnboost::throw_exception(
+                NDNBOOST_IOSTREAMS_FAILURE("write area exhausted")
+            );
+        *pptr() = traits_type::to_char_type(c);
+        pbump(1);
+        return c;
+    }
+    return traits_type::not_eof(c);
+}
+
+template<typename T, typename Tr>
+inline typename direct_streambuf<T, Tr>::pos_type
+direct_streambuf<T, Tr>::seekoff
+    (off_type off, NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which)
+{ return seek_impl(off, way, which); }
+
+template<typename T, typename Tr>
+inline typename direct_streambuf<T, Tr>::pos_type
+direct_streambuf<T, Tr>::seekpos
+    (pos_type sp, NDNBOOST_IOS::openmode which)
+{ 
+    return seek_impl(position_to_offset(sp), NDNBOOST_IOS::beg, which);
+}
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::close_impl(NDNBOOST_IOS::openmode which)
+{
+    if (which == NDNBOOST_IOS::in && ibeg_ != 0) {
+        setg(0, 0, 0);
+        ibeg_ = iend_ = 0;
+    }
+    if (which == NDNBOOST_IOS::out && obeg_ != 0) {
+        sync();
+        setp(0, 0);
+        obeg_ = oend_ = 0;
+    }
+    ndnboost::iostreams::close(*storage_, which);
+}
+
+template<typename T, typename Tr>
+typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seek_impl
+    (stream_offset off, NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which)
+{
+    using namespace std;
+    NDNBOOST_IOS::openmode both = NDNBOOST_IOS::in | NDNBOOST_IOS::out;
+    if (two_head() && (which & both) == both)
+        ndnboost::throw_exception(bad_seek());
+    stream_offset result = -1;
+    bool one = one_head();
+    if (one && (pptr() != 0 || gptr()== 0))
+        init_get_area(); // Switch to input mode, for code reuse.
+    if (one || ((which & NDNBOOST_IOS::in) != 0 && ibeg_ != 0)) {
+        if (!gptr()) setg(ibeg_, ibeg_, iend_);
+        ptrdiff_t next = 0;
+        switch (way) {
+        case NDNBOOST_IOS::beg: next = off; break;
+        case NDNBOOST_IOS::cur: next = (gptr() - ibeg_) + off; break;
+        case NDNBOOST_IOS::end: next = (iend_ - ibeg_) + off; break;
+        default: NDNBOOST_ASSERT(0);
+        }
+        if (next < 0 || next > (iend_ - ibeg_))
+            ndnboost::throw_exception(bad_seek());
+        setg(ibeg_, ibeg_ + next, iend_);
+        result = next;
+    }
+    if (!one && (which & NDNBOOST_IOS::out) != 0 && obeg_ != 0) {
+        if (!pptr()) setp(obeg_, oend_);
+        ptrdiff_t next = 0;
+        switch (way) {
+        case NDNBOOST_IOS::beg: next = off; break;
+        case NDNBOOST_IOS::cur: next = (pptr() - obeg_) + off; break;
+        case NDNBOOST_IOS::end: next = (oend_ - obeg_) + off; break;
+        default: NDNBOOST_ASSERT(0);
+        }
+        if (next < 0 || next > (oend_ - obeg_))
+            ndnboost::throw_exception(bad_seek());
+        pbump(static_cast<int>(next - (pptr() - obeg_)));
+        result = next;
+    }
+    return offset_to_position(result);
+}
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::init_input(input)
+{
+    std::pair<char_type*, char_type*> p = input_sequence(*storage_);
+    ibeg_ = p.first;
+    iend_ = p.second;
+}
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::init_output(output)
+{
+    std::pair<char_type*, char_type*> p = output_sequence(*storage_);
+    obeg_ = p.first;
+    oend_ = p.second;
+}
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::init_get_area()
+{
+    setg(ibeg_, ibeg_, iend_);
+    if (one_head() && pptr()) {
+        gbump(static_cast<int>(pptr() - obeg_));
+        setp(0, 0);
+    }
+}
+
+template<typename T, typename Tr>
+void direct_streambuf<T, Tr>::init_put_area()
+{
+    setp(obeg_, oend_);
+    if (one_head() && gptr()) {
+        pbump(static_cast<int>(gptr() - ibeg_));
+        setg(0, 0, 0);
+    }
+}
+
+template<typename T, typename Tr>
+inline bool direct_streambuf<T, Tr>::one_head() const
+{ return ibeg_ && obeg_ && ibeg_ == obeg_; }
+
+template<typename T, typename Tr>
+inline bool direct_streambuf<T, Tr>::two_head() const
+{ return ibeg_ && obeg_ && ibeg_ != obeg_; }
+
+//----------------------------------------------------------------------------//
+
+} // End namespace detail.
+
+} } // End namespaces iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp> // MSVC
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_DIRECT_STREAMBUF_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/streambuf/indirect_streambuf.hpp b/include/ndnboost/iostreams/detail/streambuf/indirect_streambuf.hpp
new file mode 100644
index 0000000..d657ddb
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/streambuf/indirect_streambuf.hpp
@@ -0,0 +1,432 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// This material is heavily indebted to the discussion and code samples in
+// A. Langer and K. Kreft, "Standard C++ IOStreams and Locales",
+// Addison-Wesley, 2000, pp. 228-43.
+
+// User "GMSB" provided an optimization for small seeks.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_INDIRECT_STREAMBUF_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_INDIRECT_STREAMBUF_HPP_INCLUDED
+
+#include <algorithm>                             // min, max.
+#include <cassert>
+#include <exception>
+#include <typeinfo>
+#include <ndnboost/config.hpp>                      // Member template friends.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/constants.hpp>
+#include <ndnboost/iostreams/detail/adapter/concept_adapter.hpp>
+#include <ndnboost/iostreams/detail/buffer.hpp>
+#include <ndnboost/iostreams/detail/config/wide_streams.hpp>
+#include <ndnboost/iostreams/detail/double_object.hpp> 
+#include <ndnboost/iostreams/detail/execute.hpp>
+#include <ndnboost/iostreams/detail/functional.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>
+#include <ndnboost/iostreams/detail/optional.hpp>
+#include <ndnboost/iostreams/detail/push.hpp>
+#include <ndnboost/iostreams/detail/streambuf/linked_streambuf.hpp>
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/iostreams/positioning.hpp>
+#include <ndnboost/iostreams/traits.hpp>
+#include <ndnboost/iostreams/operations.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp>  // MSVC, BCC 5.x
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+//
+// Description: The implementation of basic_streambuf used by chains.
+//
+template<typename T, typename Tr, typename Alloc, typename Mode>
+class indirect_streambuf
+    : public linked_streambuf<NDNBOOST_DEDUCED_TYPENAME char_type_of<T>::type, Tr>
+{
+public:
+    typedef typename char_type_of<T>::type                    char_type;
+    NDNBOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr)
+private:
+    typedef typename category_of<T>::type                     category;
+    typedef concept_adapter<T>                                wrapper;
+    typedef detail::basic_buffer<char_type, Alloc>            buffer_type;
+    typedef indirect_streambuf<T, Tr, Alloc, Mode>            my_type;
+    typedef detail::linked_streambuf<char_type, traits_type>  base_type;
+    typedef linked_streambuf<char_type, Tr>                   streambuf_type;
+public:
+    indirect_streambuf();
+
+    void open(const T& t NDNBOOST_IOSTREAMS_PUSH_PARAMS());
+    bool is_open() const;
+    void close();
+    bool auto_close() const;
+    void set_auto_close(bool close);
+    bool strict_sync();
+
+    // Declared in linked_streambuf.
+    T* component() { return &*obj(); }
+protected:
+#if !NDNBOOST_WORKAROUND(__GNUC__, == 2)
+    NDNBOOST_IOSTREAMS_USING_PROTECTED_STREAMBUF_MEMBERS(base_type)
+#endif
+
+    //----------virtual functions---------------------------------------------//
+
+#ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+    void imbue(const std::locale& loc);
+#endif
+#ifdef NDNBOOST_IOSTREAMS_NO_STREAM_TEMPLATES
+    public:
+#endif
+    int_type underflow();
+    int_type pbackfail(int_type c);
+    int_type overflow(int_type c);
+    int sync();
+    pos_type seekoff( off_type off, NDNBOOST_IOS::seekdir way,
+                      NDNBOOST_IOS::openmode which );
+    pos_type seekpos(pos_type sp, NDNBOOST_IOS::openmode which);
+
+    // Declared in linked_streambuf.
+    void set_next(streambuf_type* next);
+    void close_impl(NDNBOOST_IOS::openmode m);
+    const std::type_info& component_type() const { return typeid(T); }
+    void* component_impl() { return component(); }
+private:
+
+    //----------Accessor functions--------------------------------------------//
+
+    wrapper& obj() { return *storage_; }
+    streambuf_type* next() const { return next_; }
+    buffer_type& in() { return buffer_.first(); }
+    buffer_type& out() { return buffer_.second(); }
+    bool can_read() const { return is_convertible<Mode, input>::value; }
+    bool can_write() const { return is_convertible<Mode, output>::value; }
+    bool output_buffered() const { return (flags_ & f_output_buffered) != 0; }
+    bool shared_buffer() const { return is_convertible<Mode, seekable>::value; }
+    void set_flags(int f) { flags_ = f; }
+
+    //----------State changing functions--------------------------------------//
+
+    virtual void init_get_area();
+    virtual void init_put_area();
+
+    //----------Utility function----------------------------------------------//
+
+    pos_type seek_impl( stream_offset off, NDNBOOST_IOS::seekdir way,
+                        NDNBOOST_IOS::openmode which );
+    void sync_impl();
+
+    enum flag_type {
+        f_open             = 1,
+        f_output_buffered  = f_open << 1,
+        f_auto_close       = f_output_buffered << 1
+    };
+
+    optional<wrapper>           storage_;
+    streambuf_type*             next_;
+    double_object<
+        buffer_type,
+        is_convertible<
+            Mode,
+            two_sequence
+        >
+    >                           buffer_;
+    std::streamsize             pback_size_;
+    int                         flags_;
+};
+
+//--------------Implementation of indirect_streambuf--------------------------//
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+indirect_streambuf<T, Tr, Alloc, Mode>::indirect_streambuf()
+    : next_(0), pback_size_(0), flags_(f_auto_close) { }
+
+//--------------Implementation of open, is_open and close---------------------//
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::open
+    (const T& t, std::streamsize buffer_size, std::streamsize pback_size)
+{
+    using namespace std;
+
+    // Normalize buffer sizes.
+    buffer_size =
+        (buffer_size != -1) ?
+        buffer_size :
+        iostreams::optimal_buffer_size(t);
+    pback_size =
+        (pback_size != -1) ?
+        pback_size :
+        default_pback_buffer_size;
+
+    // Construct input buffer.
+    if (can_read()) {
+        pback_size_ = (std::max)(std::streamsize(2), pback_size); // STLPort needs 2.
+        std::streamsize size =
+            pback_size_ +
+            ( buffer_size ? buffer_size: 1 );
+        in().resize(size);
+        if (!shared_buffer())
+            init_get_area();
+    }
+
+    // Construct output buffer.
+    if (can_write() && !shared_buffer()) {
+        if (buffer_size != 0)
+            out().resize(buffer_size);
+        init_put_area();
+    }
+
+    storage_.reset(wrapper(t));
+    flags_ |= f_open;
+    if (can_write() && buffer_size > 1)
+        flags_ |= f_output_buffered;
+    this->set_true_eof(false);
+    this->set_needs_close();
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open() const
+{ return (flags_ & f_open) != 0; }
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::close()
+{
+    using namespace std;
+    base_type* self = this;
+    detail::execute_all(
+        detail::call_member_close(*self, NDNBOOST_IOS::in),
+        detail::call_member_close(*self, NDNBOOST_IOS::out),
+        detail::call_reset(storage_),
+        detail::clear_flags(flags_)
+    );
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+bool indirect_streambuf<T, Tr, Alloc, Mode>::auto_close() const
+{ return (flags_ & f_auto_close) != 0; }
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::set_auto_close(bool close)
+{ flags_ = (flags_ & ~f_auto_close) | (close ? f_auto_close : 0); }
+
+//--------------Implementation virtual functions------------------------------//
+
+#ifndef NDNBOOST_IOSTREAMS_NO_LOCALE
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::imbue(const std::locale& loc)
+{
+    if (is_open()) {
+        obj().imbue(loc);
+        if (next_)
+            next_->pubimbue(loc);
+    }
+}
+#endif
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+typename indirect_streambuf<T, Tr, Alloc, Mode>::int_type
+indirect_streambuf<T, Tr, Alloc, Mode>::underflow()
+{
+    using namespace std;
+    if (!gptr()) init_get_area();
+    buffer_type& buf = in();
+    if (gptr() < egptr()) return traits_type::to_int_type(*gptr());
+
+    // Fill putback buffer.
+    std::streamsize keep = 
+        (std::min)( static_cast<std::streamsize>(gptr() - eback()),
+                    pback_size_ );
+    if (keep)
+        traits_type::move( buf.data() + (pback_size_ - keep),
+                           gptr() - keep, keep );
+
+    // Set pointers to reasonable values in case read throws.
+    setg( buf.data() + pback_size_ - keep,
+          buf.data() + pback_size_,
+          buf.data() + pback_size_ );
+
+    // Read from source.
+    std::streamsize chars =
+        obj().read(buf.data() + pback_size_, buf.size() - pback_size_, next_);
+    if (chars == -1) {
+        this->set_true_eof(true);
+        chars = 0;
+    }
+    setg(eback(), gptr(), buf.data() + pback_size_ + chars);
+    return chars != 0 ?
+        traits_type::to_int_type(*gptr()) :
+        traits_type::eof();
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+typename indirect_streambuf<T, Tr, Alloc, Mode>::int_type
+indirect_streambuf<T, Tr, Alloc, Mode>::pbackfail(int_type c)
+{
+    if (gptr() != eback()) {
+        gbump(-1);
+        if (!traits_type::eq_int_type(c, traits_type::eof()))
+            *gptr() = traits_type::to_char_type(c);
+        return traits_type::not_eof(c);
+    } else {
+        ndnboost::throw_exception(bad_putback());
+    }
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+typename indirect_streambuf<T, Tr, Alloc, Mode>::int_type
+indirect_streambuf<T, Tr, Alloc, Mode>::overflow(int_type c)
+{
+    if ( (output_buffered() && pptr() == 0) ||
+         (shared_buffer() && gptr() != 0) )
+    {
+        init_put_area();
+    }
+    if (!traits_type::eq_int_type(c, traits_type::eof())) {
+        if (output_buffered()) {
+            if (pptr() == epptr()) {
+                sync_impl();
+                if (pptr() == epptr())
+                    return traits_type::eof();
+            }
+            *pptr() = traits_type::to_char_type(c);
+            pbump(1);
+        } else {
+            char_type d = traits_type::to_char_type(c);
+            if (obj().write(&d, 1, next_) != 1)
+                return traits_type::eof();
+        }
+    }
+    return traits_type::not_eof(c);
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+int indirect_streambuf<T, Tr, Alloc, Mode>::sync()
+{
+    try { // sync() is no-throw.
+        sync_impl();
+        obj().flush(next_);
+        return 0;
+    } catch (...) { return -1; }
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+bool indirect_streambuf<T, Tr, Alloc, Mode>::strict_sync()
+{
+    try { // sync() is no-throw.
+        sync_impl();
+        return obj().flush(next_);
+    } catch (...) { return false; }
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+inline typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
+indirect_streambuf<T, Tr, Alloc, Mode>::seekoff
+    (off_type off, NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which)
+{ return seek_impl(off, way, which); }
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+inline typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
+indirect_streambuf<T, Tr, Alloc, Mode>::seekpos
+    (pos_type sp, NDNBOOST_IOS::openmode which)
+{ 
+    return seek_impl(position_to_offset(sp), NDNBOOST_IOS::beg, which); 
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
+indirect_streambuf<T, Tr, Alloc, Mode>::seek_impl
+    (stream_offset off, NDNBOOST_IOS::seekdir way, NDNBOOST_IOS::openmode which)
+{
+    if ( gptr() != 0 && way == NDNBOOST_IOS::cur && which == NDNBOOST_IOS::in && 
+         eback() - gptr() <= off && off <= egptr() - gptr() ) 
+    {   // Small seek optimization
+        gbump(off);
+        return obj().seek(0, NDNBOOST_IOS::cur, NDNBOOST_IOS::in, next_) -
+               static_cast<off_type>(egptr() - gptr());
+    }
+    if (pptr() != 0) 
+        this->NDNBOOST_IOSTREAMS_PUBSYNC(); // sync() confuses VisualAge 6.
+    if (way == NDNBOOST_IOS::cur && gptr())
+        off -= static_cast<off_type>(egptr() - gptr());
+    setg(0, 0, 0);
+    setp(0, 0);
+    return obj().seek(off, way, which, next_);
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+inline void indirect_streambuf<T, Tr, Alloc, Mode>::set_next
+    (streambuf_type* next)
+{ next_ = next; }
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+inline void indirect_streambuf<T, Tr, Alloc, Mode>::close_impl
+    (NDNBOOST_IOS::openmode which)
+{
+    if (which == NDNBOOST_IOS::in && is_convertible<Mode, input>::value) {
+        setg(0, 0, 0);
+    }
+    if (which == NDNBOOST_IOS::out && is_convertible<Mode, output>::value) {
+        sync();
+        setp(0, 0);
+    }
+    if ( !is_convertible<category, dual_use>::value ||
+         is_convertible<Mode, input>::value == (which == NDNBOOST_IOS::in) )
+    {
+        obj().close(which, next_);
+    }
+}
+
+//----------State changing functions------------------------------------------//
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::sync_impl()
+{
+    std::streamsize avail, amt;
+    if ((avail = static_cast<std::streamsize>(pptr() - pbase())) > 0) {
+        if ((amt = obj().write(pbase(), avail, next())) == avail)
+            setp(out().begin(), out().end());
+        else {
+            const char_type* ptr = pptr();
+            setp(out().begin() + amt, out().end());
+            pbump(ptr - pptr());
+        }
+    }
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::init_get_area()
+{
+    if (shared_buffer() && pptr() != 0) {
+        sync_impl();
+        setp(0, 0);
+    }
+    setg(in().begin(), in().begin(), in().begin());
+}
+
+template<typename T, typename Tr, typename Alloc, typename Mode>
+void indirect_streambuf<T, Tr, Alloc, Mode>::init_put_area()
+{
+    using namespace std;
+    if (shared_buffer() && gptr() != 0)
+        setg(0, 0, 0);
+    if (output_buffered())
+        setp(out().begin(), out().end());
+    else
+        setp(0, 0);
+}
+
+//----------------------------------------------------------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp> // MSVC, BCC 5.x
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_INDIRECT_STREAMBUF_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/streambuf/linked_streambuf.hpp b/include/ndnboost/iostreams/detail/streambuf/linked_streambuf.hpp
new file mode 100644
index 0000000..d6ec23d
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/streambuf/linked_streambuf.hpp
@@ -0,0 +1,114 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_LINKED_STREAMBUF_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_LINKED_STREAMBUF_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <typeinfo>
+#include <ndnboost/config.hpp>                        // member template friends.
+#include <ndnboost/iostreams/detail/char_traits.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>          // openmode.
+#include <ndnboost/iostreams/detail/streambuf.hpp>
+
+// Must come last.
+#include <ndnboost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+class chain_base;
+
+template<typename Chain, typename Access, typename Mode> class chainbuf;
+
+#define NDNBOOST_IOSTREAMS_USING_PROTECTED_STREAMBUF_MEMBERS(base) \
+    using base::eback; using base::gptr; using base::egptr; \
+    using base::setg; using base::gbump; using base::pbase; \
+    using base::pptr; using base::epptr; using base::setp; \
+    using base::pbump; using base::underflow; using base::pbackfail; \
+    using base::xsgetn; using base::overflow; using base::xsputn; \
+    using base::sync; using base::seekoff; using base::seekpos; \
+    /**/
+
+template<typename Ch, typename Tr = NDNBOOST_IOSTREAMS_CHAR_TRAITS(Ch) >
+class linked_streambuf : public NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(Ch, Tr) {
+protected:
+    linked_streambuf() : flags_(0) { }
+    void set_true_eof(bool eof) 
+    { 
+        flags_ = (flags_ & ~f_true_eof) | (eof ? f_true_eof : 0); 
+    }
+public:
+
+    // Should be called only after receiving an ordinary EOF indication,
+    // to confirm that it represents EOF rather than WOULD_BLOCK.
+    bool true_eof() const { return (flags_ & f_true_eof) != 0; }
+protected:
+
+    //----------grant friendship to chain_base and chainbuf-------------------//
+
+#ifndef NDNBOOST_NO_MEMBER_TEMPLATE_FRIENDS
+    template< typename Self, typename ChT, typename TrT,
+              typename Alloc, typename Mode >
+    friend class chain_base;
+    template<typename Chain, typename Mode, typename Access>
+    friend class chainbuf;
+    template<typename U>
+    friend class member_close_operation; 
+#else
+    public:
+        typedef NDNBOOST_IOSTREAMS_BASIC_STREAMBUF(Ch, Tr) base;
+        NDNBOOST_IOSTREAMS_USING_PROTECTED_STREAMBUF_MEMBERS(base)
+#endif
+    void close(NDNBOOST_IOS::openmode which)
+    {
+        if ( which == NDNBOOST_IOS::in && 
+            (flags_ & f_input_closed) == 0 )
+        {
+            flags_ |= f_input_closed;
+            close_impl(which);
+        }
+        if ( which == NDNBOOST_IOS::out && 
+            (flags_ & f_output_closed) == 0 )
+        {
+            flags_ |= f_output_closed;
+            close_impl(which);
+        }
+    }
+    void set_needs_close()
+    {
+        flags_ &= ~(f_input_closed | f_output_closed);
+    }
+    virtual void set_next(linked_streambuf<Ch, Tr>* /* next */) { }
+    virtual void close_impl(NDNBOOST_IOS::openmode) = 0;
+    virtual bool auto_close() const = 0;
+    virtual void set_auto_close(bool) = 0;
+    virtual bool strict_sync() = 0;
+    virtual const std::type_info& component_type() const = 0;
+    virtual void* component_impl() = 0;
+#ifndef NDNBOOST_NO_MEMBER_TEMPLATE_FRIENDS
+    private:
+#else
+    public:
+#endif
+private:
+    enum flag_type {
+        f_true_eof       = 1,
+        f_input_closed   = f_true_eof << 1,
+        f_output_closed  = f_input_closed << 1
+    };
+    int flags_;
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#include <ndnboost/iostreams/detail/config/enable_warnings.hpp> // MSVC.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_LINKED_STREAMBUF_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/system_failure.hpp b/include/ndnboost/iostreams/detail/system_failure.hpp
new file mode 100644
index 0000000..4a9dcbc
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/system_failure.hpp
@@ -0,0 +1,84 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// (C) Copyright Jonathan Graehl 2004.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+// Used by mapped_file.cpp.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_SYSTEM_FAILURE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_SYSTEM_FAILURE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <cstring>
+#include <string>
+#include <ndnboost/config.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/iostreams/detail/config/windows_posix.hpp>
+#include <ndnboost/iostreams/detail/ios.hpp>  // failure.
+
+#if defined(NDNBOOST_NO_STDC_NAMESPACE) && !defined(__LIBCOMO__)
+namespace std { using ::strlen; }
+#endif
+
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+# define WIN32_LEAN_AND_MEAN  // Exclude rarely-used stuff from Windows headers
+# include <windows.h>
+#else
+# include <errno.h>
+# include <string.h>
+#endif
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+inline NDNBOOST_IOSTREAMS_FAILURE system_failure(const char* msg)
+{
+    std::string result;
+#ifdef NDNBOOST_IOSTREAMS_WINDOWS
+    DWORD err;
+    LPVOID lpMsgBuf;
+    if ( (err = ::GetLastError()) != NO_ERROR &&
+         ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                           FORMAT_MESSAGE_FROM_SYSTEM,
+                           NULL,
+                           err,
+                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                           (LPSTR) &lpMsgBuf,
+                           0,
+                           NULL ) != 0 )
+    {
+        result.reserve(std::strlen(msg) + 2 + std::strlen((LPSTR)lpMsgBuf));
+        result.append(msg);
+        result.append(": ");
+        result.append((LPSTR) lpMsgBuf);
+        ::LocalFree(lpMsgBuf);
+    } else {
+        result += msg;
+    }
+#else
+    const char* system_msg = errno ? strerror(errno) : "";
+    result.reserve(std::strlen(msg) + 2 + std::strlen(system_msg));
+    result.append(msg);
+    result.append(": ");
+    result.append(system_msg);
+#endif
+    return NDNBOOST_IOSTREAMS_FAILURE(result);
+}
+
+inline NDNBOOST_IOSTREAMS_FAILURE system_failure(const std::string& msg)
+{ return system_failure(msg.c_str()); }
+
+inline void throw_system_failure(const char* msg)
+{ ndnboost::throw_exception(system_failure(msg)); }
+
+inline void throw_system_failure(const std::string& msg)
+{ ndnboost::throw_exception(system_failure(msg)); }
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_SYSTEM_FAILURE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/template_params.hpp b/include/ndnboost/iostreams/detail/template_params.hpp
new file mode 100644
index 0000000..aeaaff3
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/template_params.hpp
@@ -0,0 +1,26 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_TEMPLATE_PARAMS_HPP_INCLUDED
+
+#include <ndnboost/preprocessor/control/expr_if.hpp>
+#include <ndnboost/preprocessor/control/if.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+
+#define NDNBOOST_IOSTREAMS_TEMPLATE_PARAMS(arity, param) \
+    NDNBOOST_PP_EXPR_IF(arity, template<) \
+    NDNBOOST_PP_ENUM_PARAMS(arity, typename param) \
+    NDNBOOST_PP_EXPR_IF(arity, >) \
+    /**/
+
+#define NDNBOOST_IOSTREAMS_TEMPLATE_ARGS(arity, param) \
+    NDNBOOST_PP_EXPR_IF(arity, <) \
+    NDNBOOST_PP_ENUM_PARAMS(arity, param) \
+    NDNBOOST_PP_EXPR_IF(arity, >) \
+    /**/
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_BUFFERS_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/translate_int_type.hpp b/include/ndnboost/iostreams/detail/translate_int_type.hpp
new file mode 100644
index 0000000..e5cbb63
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/translate_int_type.hpp
@@ -0,0 +1,62 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_TRANSLATE_INT_TYPE_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_TRANSLATE_INT_TYPE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/type_traits/is_same.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+
+template<bool IsSame>
+struct translate_int_type_impl;
+
+//
+// Template name: translate_char.
+// Description: Translates a character or an end-of-file indicator from the 
+//      int_type of one character traits type to the int_type of another.
+//
+template<typename SourceTr, typename TargetTr>
+typename TargetTr::int_type 
+translate_int_type(typename SourceTr::int_type c) 
+{ 
+    typedef translate_int_type_impl<is_same<SourceTr, TargetTr>::value> impl;
+    return impl::template inner<SourceTr, TargetTr>::translate(c);
+}
+
+//----------------------------------------------------------------------------//
+
+template<>
+struct translate_int_type_impl<true> {
+    template<typename SourceTr, typename TargetTr>
+    struct inner {
+        static typename TargetTr::int_type 
+        translate(typename SourceTr::int_type c) { return c; }
+    };
+};
+
+template<>
+struct translate_int_type_impl<false> {
+    template<typename SourceTr, typename TargetTr>
+    struct inner {
+        static typename TargetTr::int_type 
+        translate(typename SourceTr::int_type c)
+            { 
+                return SourceTr::eq_int_type(SourceTr::eof()) ?
+                           TargetTr::eof() :
+                           TargetTr::to_int_type(SourceTr::to_char_type(c));
+            }
+    };
+};
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_TRANSLATE_INT_TYPE_HPP_INCLUDED
diff --git a/include/ndnboost/iostreams/detail/vc6/close.hpp b/include/ndnboost/iostreams/detail/vc6/close.hpp
new file mode 100644
index 0000000..2fddd11
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/vc6/close.hpp
@@ -0,0 +1,129 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+namespace ndnboost { namespace iostreams {
+
+namespace detail {
+
+template<typename T>
+struct close_impl;
+
+} // End namespace detail.
+
+template<typename T>
+void close(T& t) { detail::close_all(t); }
+
+template<typename T>
+void close(T& t, NDNBOOST_IOS::openmode which)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    detail::close_impl<T>::inner<unwrapped>::close(detail::unwrap(t), which);
+}
+
+template<typename T, typename Sink>
+void close(T& t, Sink& snk, NDNBOOST_IOS::openmode which)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    detail::close_impl<T>::inner<unwrapped>::close(detail::unwrap(t), snk, which);
+}
+
+namespace detail {
+
+//------------------Definition of close_impl----------------------------------//
+
+template<typename T>
+struct close_tag {
+    typedef typename category_of<T>::type category;
+    typedef typename
+            mpl::eval_if<
+                is_convertible<category, closable_tag>,
+                mpl::if_<
+                    mpl::or_<
+                        is_convertible<category, two_sequence>,
+                        is_convertible<category, dual_use>
+                    >,
+                    two_sequence,
+                    closable_tag
+                >,
+                mpl::identity<any_tag>
+            >::type type;
+};
+
+template<typename T>
+struct close_impl
+    : mpl::if_<
+          is_custom<T>,
+          operations<T>,
+          close_impl<NDNBOOST_DEDUCED_TYPENAME close_tag<T>::type>
+      >::type
+    { };
+
+template<>
+struct close_impl<any_tag> {
+    template<typename T>
+    struct inner {
+        static void close(T& t, NDNBOOST_IOS::openmode which)
+        {
+            if (which == NDNBOOST_IOS::out)
+                iostreams::flush(t);
+        }
+
+        template<typename Sink>
+        static void close(T& t, Sink& snk, NDNBOOST_IOS::openmode which)
+        {
+            if (which == NDNBOOST_IOS::out) {
+                non_blocking_adapter<Sink> nb(snk);
+                iostreams::flush(t, nb);
+            }
+        }
+    };
+};
+
+template<>
+struct close_impl<closable_tag> {
+    template<typename T>
+    struct inner {
+        static void close(T& t, NDNBOOST_IOS::openmode which)
+        {
+            typedef typename category_of<T>::type category;
+            const bool in =  is_convertible<category, input>::value &&
+                            !is_convertible<category, output>::value;
+            if (in == (which == NDNBOOST_IOS::in))
+                t.close();
+        }
+        template<typename Sink>
+        static void close(T& t, Sink& snk, NDNBOOST_IOS::openmode which)
+        {
+            typedef typename category_of<T>::type category;
+            const bool in =  is_convertible<category, input>::value &&
+                            !is_convertible<category, output>::value;
+            if (in == (which == NDNBOOST_IOS::in)) {
+                non_blocking_adapter<Sink> nb(snk);
+                t.close(nb);
+            }
+        }
+    };
+};
+
+template<>
+struct close_impl<two_sequence> {
+    template<typename T>
+    struct inner {
+        static void close(T& t, NDNBOOST_IOS::openmode which) { t.close(which); }
+
+        template<typename Sink>
+        static void close(T& t, Sink& snk, NDNBOOST_IOS::openmode which)
+        {
+            non_blocking_adapter<Sink> nb(snk);
+            t.close(nb, which);
+        }
+    };
+};
+
+} // End namespace detail.
+
+} } // End namespaces iostreams, boost.
diff --git a/include/ndnboost/iostreams/detail/vc6/read.hpp b/include/ndnboost/iostreams/detail/vc6/read.hpp
new file mode 100644
index 0000000..b664ae6
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/vc6/read.hpp
@@ -0,0 +1,238 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+namespace ndnboost { namespace iostreams {
+
+namespace detail {
+
+template<typename T> 
+struct read_device_impl;
+
+template<typename T> 
+struct read_filter_impl;
+
+} // End namespace detail.
+
+template<typename T>
+typename int_type_of<T>::type get(T& t)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::read_device_impl<T>::inner<unwrapped>::get(detail::unwrap(t));
+}
+
+template<typename T>
+inline std::streamsize
+read(T& t, typename char_type_of<T>::type* s, std::streamsize n)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::read_device_impl<T>::inner<unwrapped>::read(detail::unwrap(t), s, n);
+}
+
+template<typename T, typename Source>
+std::streamsize
+read(T& t, Source& src, typename char_type_of<T>::type* s, std::streamsize n)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::read_filter_impl<T>::inner<unwrapped>::read(detail::unwrap(t), src, s, n);
+}
+
+template<typename T>
+bool putback(T& t, typename char_type_of<T>::type c)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::read_device_impl<T>::inner<unwrapped>::putback(detail::unwrap(t), c);
+}
+
+//----------------------------------------------------------------------------//
+
+namespace detail {
+
+// Helper function for adding -1 as EOF indicator.
+inline std::streamsize check_eof(std::streamsize n) { return n != 0 ? n : -1; }
+
+// Helper templates for reading from streambufs.
+template<bool IsLinked>
+struct true_eof_impl;
+
+template<>
+struct true_eof_impl<true> {
+    template<typename T>
+    static bool true_eof(T& t) { return t.true_eof(); }
+};
+
+template<>
+struct true_eof_impl<false> {
+    template<typename T>
+    static bool true_eof(T& t) { return true; }
+};
+
+template<typename T>
+inline bool true_eof(T& t)
+{
+    const bool linked = is_linked<T>::value;
+    return true_eof_impl<linked>::true_eof(t);
+}
+                    
+//------------------Definition of read_device_impl----------------------------//
+
+template<typename T>
+struct read_device_impl
+    : mpl::if_<
+          detail::is_custom<T>,
+          operations<T>,
+          read_device_impl<
+              NDNBOOST_DEDUCED_TYPENAME
+              detail::dispatch<
+                  T, istream_tag, streambuf_tag, input
+              >::type
+          >
+      >::type
+    { };
+
+template<>
+struct read_device_impl<istream_tag> {
+    template<typename T>
+    struct inner {
+        static typename int_type_of<T>::type get(T& t)
+        { return t.get(); }
+
+        static std::streamsize
+        read(T& t, typename char_type_of<T>::type* s, std::streamsize n)
+        { return check_eof(t.rdbuf()->sgetn(s, n)); }
+
+        static bool putback(T& t, typename char_type_of<T>::type c)
+        {
+            typedef typename char_type_of<T>::type          char_type;
+            typedef NDNBOOST_IOSTREAMS_CHAR_TRAITS(char_type)  traits_type;
+            return !traits_type::eq_int_type( t.rdbuf()->sputbackc(c),
+                                              traits_type::eof() );
+        }
+    };
+};
+
+template<>
+struct read_device_impl<streambuf_tag> {
+    template<typename T>
+    struct inner {
+        static typename int_type_of<T>::type
+        get(T& t)
+        {
+            typedef typename char_type_of<T>::type  char_type;
+            typedef char_traits<char_type>          traits_type;
+            typename int_type_of<T>::type c;
+            return !traits_type::is_eof(c = t.sbumpc()) ||
+                    detail::true_eof(t)
+                        ?
+                    c : traits_type::would_block();
+        }
+
+        static std::streamsize
+        read(T& t, typename char_type_of<T>::type* s, std::streamsize n)
+        {
+            std::streamsize amt;
+            return (amt = t.sgetn(s, n)) != 0 ?
+                amt :
+                detail::true_eof(t) ?
+                    -1 :
+                    0;
+        }
+
+        static bool putback(T& t, typename char_type_of<T>::type c)
+        {
+            typedef typename char_type_of<T>::type  char_type;
+            typedef char_traits<char_type>          traits_type;
+            return !traits_type::is_eof(t.sputbackc(c));
+        }
+    };
+};
+
+template<>
+struct read_device_impl<input> {
+    template<typename T>
+    struct inner {
+        static typename int_type_of<T>::type
+        get(T& t)
+        {
+            typedef typename char_type_of<T>::type  char_type;
+            typedef char_traits<char_type>          traits_type;
+            char_type c;
+            std::streamsize amt;
+            return (amt = t.read(&c, 1)) == 1 ?
+                traits_type::to_int_type(c) :
+                amt == -1 ?
+                    traits_type::eof() :
+                    traits_type::would_block();
+        }
+
+        template<typename T>
+        static std::streamsize
+        read(T& t, typename char_type_of<T>::type* s, std::streamsize n)
+        { return t.read(s, n); }
+
+        template<typename T>
+        static bool putback(T& t, typename char_type_of<T>::type c)
+        {   // T must be Peekable.
+            return t.putback(c);
+        }
+    };
+};
+
+//------------------Definition of read_filter_impl----------------------------//
+
+template<typename T>
+struct read_filter_impl
+    : mpl::if_<
+          detail::is_custom<T>,
+          operations<T>,
+          read_filter_impl<
+              NDNBOOST_DEDUCED_TYPENAME
+              detail::dispatch<
+                  T, multichar_tag, any_tag
+              >::type
+          >
+      >::type
+    { };
+
+template<>
+struct read_filter_impl<multichar_tag> {
+    template<typename T>
+    struct inner {
+        template<typename Source>
+        static std::streamsize read
+            ( T& t, Source& src, typename char_type_of<T>::type* s,   
+              std::streamsize n )
+        { return t.read(src, s, n); }
+    };
+};
+
+template<>
+struct read_filter_impl<any_tag> {
+    template<typename T>
+    struct inner {
+        template<typename Source>
+        static std::streamsize read
+            ( T& t, Source& src, typename char_type_of<T>::type* s, 
+              std::streamsize n )
+        {
+            typedef typename char_type_of<T>::type  char_type;
+            typedef char_traits<char_type>          traits_type;
+            for (std::streamsize off = 0; off < n; ++off) {
+                typename traits_type::int_type c = t.get(src);
+                if (traits_type::is_eof(c))
+                    return check_eof(off);
+                if (traits_type::would_block(c))
+                    return off;
+                s[off] = traits_type::to_char_type(c);
+            }
+            return n;
+        }
+    };
+};
+
+} // End namespace detail.
+
+} } // End namespaces iostreams, boost.
diff --git a/include/ndnboost/iostreams/detail/vc6/write.hpp b/include/ndnboost/iostreams/detail/vc6/write.hpp
new file mode 100644
index 0000000..b0398e1
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/vc6/write.hpp
@@ -0,0 +1,159 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2005-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+namespace ndnboost { namespace iostreams {
+
+namespace detail {
+
+template<typename T> 
+struct write_device_impl;
+
+template<typename T> 
+struct write_filter_impl;
+
+} // End namespace detail.
+
+template<typename T>
+bool put(T& t, typename char_type_of<T>::type c)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::write_device_impl<T>::inner<unwrapped>::put(detail::unwrap(t), c);
+}
+
+template<typename T>
+inline std::streamsize write
+    (T& t, const typename char_type_of<T>::type* s, std::streamsize n)
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::write_device_impl<T>::inner<unwrapped>::write(detail::unwrap(t), s, n);
+}
+
+template<typename T, typename Sink>
+inline std::streamsize
+write( T& t, Sink& snk, const typename char_type_of<T>::type* s, 
+       std::streamsize n )
+{
+    typedef typename detail::unwrapped_type<T>::type unwrapped;
+    return detail::write_filter_impl<T>::inner<unwrapped>::write(detail::unwrap(t), snk, s, n);
+}
+
+namespace detail {
+
+//------------------Definition of write_device_impl---------------------------//
+
+template<typename T>
+struct write_device_impl
+    : mpl::if_<
+          is_custom<T>,
+          operations<T>,
+          write_device_impl<
+              NDNBOOST_DEDUCED_TYPENAME
+              dispatch<
+                  T, ostream_tag, streambuf_tag, output
+              >::type
+          >
+      >::type
+    { };
+
+template<>
+struct write_device_impl<ostream_tag> {
+    template<typename T>
+    struct inner {
+        static bool put(T& t, typename char_type_of<T>::type c)
+        {
+            typedef typename char_type_of<T>::type          char_type;
+            typedef NDNBOOST_IOSTREAMS_CHAR_TRAITS(char_type)  traits_type;
+            return !traits_type::eq_int_type( t.rdbuf()->s.sputc(),
+                                            traits_type::eof() );
+        }
+
+        static std::streamsize write
+            (T& t, const typename char_type_of<T>::type* s, std::streamsize n)
+        { return t.rdbuf()->sputn(s, n); }
+    };
+};
+
+template<>
+struct write_device_impl<streambuf_tag> {
+    template<typename T>
+    struct inner {
+        static bool put(T& t, typename char_type_of<T>::type c)
+        {
+            typedef typename char_type_of<T>::type          char_type;
+            typedef NDNBOOST_IOSTREAMS_CHAR_TRAITS(char_type)  traits_type;
+            return !traits_type::eq_int_type(t.sputc(c), traits_type::eof());
+        }
+
+        template<typename T>
+        static std::streamsize write
+            (T& t, const typename char_type_of<T>::type* s, std::streamsize n)
+        { return t.sputn(s, n); }
+    };
+};
+
+template<>
+struct write_device_impl<output> {
+    template<typename T>
+    struct inner {
+        static bool put(T& t, typename char_type_of<T>::type c)
+        { return t.write(&c, 1) == 1; }
+
+        template<typename T>
+        static std::streamsize
+        write(T& t, const typename char_type_of<T>::type* s, std::streamsize n)
+        { return t.write(s, n); }
+    };
+};
+
+//------------------Definition of write_filter_impl---------------------------//
+
+template<typename T>
+struct write_filter_impl
+    : mpl::if_<
+          is_custom<T>,
+          operations<T>,
+          write_filter_impl<
+              NDNBOOST_DEDUCED_TYPENAME
+              dispatch<
+                  T, multichar_tag, any_tag
+              >::type
+          >
+      >::type
+    { };
+
+template<>
+struct write_filter_impl<multichar_tag> {
+    template<typename T>
+    struct inner {
+        template<typename Sink>
+        static std::streamsize
+        write( T& t, Sink& snk, const typename char_type_of<T>::type* s,
+               std::streamsize n )
+        { return t.write(snk, s, n); }
+    };
+};
+
+template<>
+struct write_filter_impl<any_tag> {
+    template<typename T>
+    struct inner {
+        template<typename Sink>
+        static std::streamsize
+        write( T& t, Sink& snk, const typename char_type_of<T>::type* s,
+               std::streamsize n )
+        {
+            for (std::streamsize off = 0; off < n; ++off)
+                if (!t.put(snk, s[off]))
+                    return off;
+            return n;
+        }
+    };
+};
+
+} // End namespace detail.
+
+} } // End namespaces iostreams, boost.
diff --git a/include/ndnboost/iostreams/detail/wrap_unwrap.hpp b/include/ndnboost/iostreams/detail/wrap_unwrap.hpp
new file mode 100644
index 0000000..93291df
--- /dev/null
+++ b/include/ndnboost/iostreams/detail/wrap_unwrap.hpp
@@ -0,0 +1,127 @@
+// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
+// (C) Copyright 2003-2007 Jonathan Turkanis
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+
+// See http://www.boost.org/libs/iostreams for documentation.
+
+#ifndef NDNBOOST_IOSTREAMS_DETAIL_WRAP_UNWRAP_HPP_INCLUDED
+#define NDNBOOST_IOSTREAMS_DETAIL_WRAP_UNWRAP_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif              
+
+#include <ndnboost/config.hpp>                             // SFINAE, MSVC.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/iostreams/detail/enable_if_stream.hpp>
+#include <ndnboost/iostreams/traits_fwd.hpp>               // is_std_io.
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/mpl/eval_if.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/ref.hpp>
+
+namespace ndnboost { namespace iostreams { namespace detail {
+                    
+//------------------Definition of wrap/unwrap traits--------------------------//
+
+template<typename T>
+struct wrapped_type 
+    : mpl::if_<is_std_io<T>, reference_wrapper<T>, T>
+    { };
+
+template<typename T>
+struct unwrapped_type 
+    : unwrap_reference<T>
+    { };
+
+template<typename T>
+struct unwrap_ios 
+    : mpl::eval_if<
+          is_std_io<T>, 
+          unwrap_reference<T>, 
+          mpl::identity<T>
+      >
+    { };
+
+//------------------Definition of wrap----------------------------------------//
+
+#ifndef NDNBOOST_NO_SFINAE //----------------------------------------------------//
+    template<typename T>
+    inline T wrap(const T& t NDNBOOST_IOSTREAMS_DISABLE_IF_STREAM(T)) 
+    { return t; }
+
+    template<typename T>
+    inline typename wrapped_type<T>::type
+    wrap(T& t NDNBOOST_IOSTREAMS_ENABLE_IF_STREAM(T)) { return ndnboost::ref(t); }
+#else // #ifndef NDNBOOST_NO_SFINAE //-------------------------------------------//
+    template<typename T>
+    inline typename wrapped_type<T>::type // BCC 5.x needs namespace qualification.
+    wrap_impl(const T& t, mpl::true_) { return ndnboost::ref(const_cast<T&>(t)); }
+
+    template<typename T>
+    inline typename wrapped_type<T>::type // BCC 5.x needs namespace qualification.
+    wrap_impl(T& t, mpl::true_) { return ndnboost::ref(t); }
+
+    template<typename T>
+    inline typename wrapped_type<T>::type 
+    wrap_impl(const T& t, mpl::false_) { return t; }
+
+    template<typename T>
+    inline typename wrapped_type<T>::type 
+    wrap_impl(T& t, mpl::false_) { return t; }
+
+    template<typename T>
+    inline typename wrapped_type<T>::type 
+    wrap(const T& t) { return wrap_impl(t, is_std_io<T>()); }
+
+    template<typename T>
+    inline typename wrapped_type<T>::type 
+    wrap(T& t) { return wrap_impl(t, is_std_io<T>()); }
+#endif // #ifndef NDNBOOST_NO_SFINAE //------------------------------------------//
+
+//------------------Definition of unwrap--------------------------------------//
+
+#if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1310) //----------------------------------//
+
+template<typename T>
+typename unwrapped_type<T>::type& 
+unwrap(const reference_wrapper<T>& ref) { return ref.get(); }
+
+template<typename T>
+typename unwrapped_type<T>::type& unwrap(T& t) { return t; }
+
+template<typename T>
+const typename unwrapped_type<T>::type& unwrap(const T& t) { return t; }
+
+#else // #if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1310) //-------------------------//
+
+// Since unwrap is a potential bottleneck, we avoid runtime tag dispatch.
+template<bool IsRefWrap>
+struct unwrap_impl;
+
+template<>
+struct unwrap_impl<true> {
+    template<typename T>
+    static typename unwrapped_type<T>::type& unwrap(const T& t) 
+    { return t.get(); }
+};
+
+template<>
+struct unwrap_impl<false> {
+    template<typename T>
+    static typename unwrapped_type<T>::type& unwrap(const T& t) 
+    { return const_cast<T&>(t); }
+};
+
+template<typename T>
+typename unwrapped_type<T>::type& 
+unwrap(const T& t) 
+{ return unwrap_impl<is_reference_wrapper<T>::value>::unwrap(t); }
+
+#endif // #if !NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1310) //------------------------//
+
+} } } // End namespaces detail, iostreams, boost.
+
+#endif // #ifndef NDNBOOST_IOSTREAMS_DETAIL_WRAP_UNWRAP_HPP_INCLUDED
