diff --git a/src/encoding/buffer.cpp b/src/encoding/buffer.cpp
index 0d9550b..9390079 100644
--- a/src/encoding/buffer.cpp
+++ b/src/encoding/buffer.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -35,14 +35,7 @@
               "Buffer must be MoveAssignable with noexcept");
 #endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE
 
-Buffer::Buffer()
-{
-}
-
-Buffer::Buffer(size_t size)
-  : std::vector<uint8_t>(size, 0)
-{
-}
+Buffer::Buffer() = default;
 
 Buffer::Buffer(const void* buf, size_t length)
   : std::vector<uint8_t>(reinterpret_cast<const uint8_t*>(buf),
diff --git a/src/encoding/buffer.hpp b/src/encoding/buffer.hpp
index 994fbf8..70ffec8 100644
--- a/src/encoding/buffer.hpp
+++ b/src/encoding/buffer.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2014 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -30,104 +30,50 @@
 
 namespace ndn {
 
-class Buffer;
-typedef shared_ptr<const Buffer> ConstBufferPtr;
-typedef shared_ptr<Buffer> BufferPtr;
-
 /**
- * @brief Class representing a general-use automatically managed/resized buffer
+ * @brief General-purpose automatically managed/resized buffer
  *
- * In most respect, Buffer class is equivalent to std::vector<uint8_t> and is in fact
- * uses it as a base class.  In addition to that, it provides buf() and buf<T>() helper
- * method for easier access to the underlying data (buf<T>() casts pointer to the requested class)
+ * In most respect, the Buffer class is equivalent to a `std::vector<uint8_t>`, and it in fact
+ * uses the latter as a base class. In addition to that, it provides the get<T>() helper method
+ * that automatically casts the returned pointer to the requested type.
  */
 class Buffer : public std::vector<uint8_t>
 {
 public:
-  /** @brief Creates an empty buffer
+  using std::vector<uint8_t>::vector;
+
+  /** @brief Creates an empty Buffer
    */
   Buffer();
 
-  /** @brief Creates a buffer with pre-allocated size
-   *  @param size size of the buffer to be allocated
-   */
-  explicit
-  Buffer(size_t size);
-
-  /** @brief Create a buffer by copying contents from a buffer
-   *  @param buf const pointer to buffer
+  /** @brief Creates a Buffer by copying contents from a raw buffer
+   *  @param buf const pointer to buffer to copy
    *  @param length length of the buffer to copy
    */
   Buffer(const void* buf, size_t length);
 
-  /** @brief Create a buffer by copying contents of the range [first, last)
-   *  @tparam InputIterator an InputIterator compatible with std::vector<uint8_t> constructor
-   *  @param first iterator to the first element to copy
-   *  @param last  iterator to the element immediately following the last element to copy
-   */
-  template <class InputIterator>
-  Buffer(InputIterator first, InputIterator last)
-    : std::vector<uint8_t>(first, last)
-  {
-  }
-
-  /** @return pointer to the first byte of the buffer
-   */
-  uint8_t*
-  get()
-  {
-    return &front();
-  }
-
-  /** @return pointer to the first byte of the buffer
-   *
-   *  This is same as \p .get()
-   */
-  uint8_t*
-  buf()
-  {
-    return &front();
-  }
-
-  /** @return pointer to the first byte of the buffer and reinterpret_cast
-   *          it to the requested type T
+  /** @return pointer to the first byte of the buffer, cast to the requested type T
    */
   template<class T>
   T*
-  get()
+  get() noexcept
   {
-    return reinterpret_cast<T*>(&front());
+    return reinterpret_cast<T*>(data());
   }
 
-  /** @return pointer to the first byte of the buffer
-   *
-   *  This is same as \p .get()
-   */
-  const uint8_t*
-  buf() const
-  {
-    return &front();
-  }
-
-  /** @return pointer to the first byte of the buffer
-   */
-  const uint8_t*
-  get() const
-  {
-    return &front();
-  }
-
-  /** @return const pointer to the first byte of the buffer and reinterpret_cast
-   *          it to the requested type T
+  /** @return const pointer to the first byte of the buffer, cast to the requested type T
    */
   template<class T>
   const T*
-  get() const
+  get() const noexcept
   {
-    return reinterpret_cast<const T*>(&front());
+    return reinterpret_cast<const T*>(data());
   }
 };
 
+using BufferPtr = shared_ptr<Buffer>;
+using ConstBufferPtr = shared_ptr<const Buffer>;
+
 } // namespace ndn
 
 #endif // NDN_ENCODING_BUFFER_HPP
