Module: JavaToBase64::InstanceMethods
- Defined in:
- lib/java_to_base64.rb
Instance Method Summary collapse
Instance Method Details
#to_base64 ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/java_to_base64.rb', line 28 def to_base64 byte_array_output_stream = java.io.ByteArrayOutputStream.new object_output_stream = java.io.ObjectOutputStream.new(byte_array_output_stream) object_output_stream.write_object(self) bytes = byte_array_output_stream.to_byte_array return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(bytes) end |