about summary refs log tree commit homepage
path: root/lib/rainbows/byte_slice.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/byte_slice.rb')
-rw-r--r--lib/rainbows/byte_slice.rb17
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/rainbows/byte_slice.rb b/lib/rainbows/byte_slice.rb
deleted file mode 100644
index 3bb4dd7..0000000
--- a/lib/rainbows/byte_slice.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- encoding: binary -*-
-# :enddoc:
-module Rainbows::ByteSlice
-  if String.method_defined?(:encoding)
-    def byte_slice(buf, range)
-      if buf.encoding != Encoding::BINARY
-        buf.dup.force_encoding(Encoding::BINARY)[range]
-      else
-        buf[range]
-      end
-    end
-  else
-    def byte_slice(buf, range)
-      buf[range]
-    end
-  end
-end