1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use napi_derive::napi;
use napi::Result;
use crate::binary::BinaryStream;
use crate::types::Byte;

#[napi]
impl BinaryStream {
  #[napi]
  /**
   * **readByte**
   * 
   * Reads a signed 8-bit ( 1 byte ) integer from the stream. ( -128 to 127 )
  */
  pub fn read_byte(&mut self) -> Result<i8> {
    Byte::read(self)
  }

  #[napi]
  /**
   * **writeByte**
   * 
   * Writes a signed 8-bit ( 1 byte ) integer to the stream. ( -128 to 127 )
  */
  pub fn write_byte(&mut self, value: i8) {
    Byte::write(self, value);
  }
}