use napi::bindgen_prelude::{BigInt, FromNapiValue};
use napi_derive::napi;
use napi::Result;
use crate::binary::{ BinaryStream, Endianness };
use crate::types::Int64;
#[napi]
#[derive(Clone)]
pub struct Long {}
#[napi]
impl Long {
#[napi]
pub fn read(stream: &mut BinaryStream, endian: Option<Endianness>) -> Result<BigInt> {
Int64::read(stream, endian)
}
#[napi]
pub fn write(stream: &mut BinaryStream, value: BigInt, endian: Option<Endianness>) {
Int64::write(stream, value, endian);
}
}
impl FromNapiValue for Long {
unsafe fn from_napi_value(_: napi::sys::napi_env, _: napi::sys::napi_value) -> Result<Self> {
Ok(Long {})
}
}