Skip to content

Make sysfs functions more robust #653

Closed

Description

@JakubVanek

I would like to review the following points in order to improve the implementation of the class: Sysfs.java

  • Slf4j checks for log level can be removed when formatting log function overloads are used. This way Slf4j does the checking on its own.
  • change writeString() to use FileOutputStream and better exception handling. This could also make it a little bit more faster. Also, it would integrate Removing check for writable file #650.
  • change writeInteger() to use Integer.toString().
  • change readString() to use better exception handling.
  • change getElements() to check for null return value (IntelliJ warning)

Activity

  1. self-assigned this
    on Mar 14, 2019
  2. JakubVanek commented on Mar 14, 2019

    @JakubVanek
    ContributorAuthor

    Conversion of ByteBuffer to byte[] turned out to not be a good idea (a null character was appended to the string). Using FileChannel instead of FileOutputStream seems to work with the ByteBuffer.

  3. JakubVanek commented on Mar 14, 2019

    @JakubVanek
    ContributorAuthor

    Hmmm, I switched it back to FileOutputStream + String.getBytes(), as it seems to be less complex and the path to native code is almost direct.

  4. JakubVanek commented on Mar 14, 2019

    @JakubVanek
    ContributorAuthor

    #654 should be ready.

  5. added this to the v1.0.0 milestone on Aug 18, 2019
  6. modified the milestones: v1.0.0, v1.1.0 on Sep 1, 2019
  7. JakubVanek commented on Sep 25, 2019

    @JakubVanek
    ContributorAuthor

    Not essential

  8. modified the milestones: v1.1.0, v1.0.0 on Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions